DescriptionDescription
This filter is called before to display a facet on render or refresh.
It allows to modify the output of facets.
ArgumentsArguments
Argument | Type | Description |
$html | string | Facet HTML markup |
$facet_id | integer | Facet id |
ExampleExample
PHP
functions.php
function prefix_facet_html( $html, $facet_id ) {
// If it matches facet id 1, we replace string in facet HTML.
if ( 1 === $facet_id ) {
$html = str_replace( 'Facet string', 'Another string', $html );
}
return $html;
}
add_filter( 'wp_grid_builder/facet/html', 'prefix_facet_html', 10, 2 );