/facet/html

DescriptionDescription

This filter is called before to display a facet on render or refresh.

It allows to modifies the output of facets.

ArgumentsArguments

ArgumentTypeDescription
$html stringFacet HTML markup
$facet_idinteger 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 );