Overview

Override the (placeholder) HTML for any FacetWP shortcode.

Parameters

  • $output | string | The output HTML
  • $atts | array | The array of shortcode attributes

Usage

Add an extra foobar CSS class to the pager shortcode:

How to use custom PHP code?

PHP code can be added to your (child) theme's functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info

add_filter( 'facetwp_shortcode_html', function( $output, $atts ) { if ( isset( $atts['pager'] ) ) { $output = str_replace( 'facetwp-pager', 'facetwp-pager foobar', $output ); } return $output; }, 10, 2 );

More examples