/facet/html
This filter is called before to display a facet on render or refresh.
It allows to modifies the output of facets.
Argument | Type | Description |
$html | string | Facet HTML markup |
$facet_id | integer | Facet id |
[pastacode lang=”php” manual=”function%20prefix_facet_html(%20%24html%2C%20%24facet_id%20)%20%7B%0A%0A%09%2F%2F%20If%20it%20matches%20facet%20id%201%2C%20we%20replace%20string%20in%20facet%20HTML.%20%0A%09if%20(%201%20%3D%3D%3D%20%24facet_id%20)%20%7B%20%24html%20%3D%20str_replace(%20’Facet%20string’%2C%20’Another%20string’%2C%20%24html%20)%3B%0A%0A%09%7D%0A%0A%09return%20%24html%3B%0A%0A%7D%0A%0Aadd_filter(%20’wp_grid_builder%2Ffacet%2Fhtml’%2C%20’prefix_facet_html’%2C%2010%2C%202%20)%3B” message=”” highlight=”” provider=”manual”/]