/facet/settings
This filter is called every time facet settings are queried.
It allows to dynamically change or add setting parameter(s) to a specific facet in order to change its behaviour.
Argument | Type | Description |
$settings | array | Holds facet settings |
[pastacode lang=”php” manual=”function%20prefix_facet_settings(%20%24settings%20)%20%7B%20%0A%0A%09%2F%2F%20If%20it%20matches%20facet%20id%201%2C%20change%20facet%20display%20order.%0A%09if%20(%201%20%3D%3D%3D%20%24settings%5B’id’%5D%20)%20%7B%0A%09%09%24settings%5B’orderby’%5D%20%3D%20’count’%3B%0A%09%7D%0A%0A%0A%09%2F%2F%20If%20it%20matches%20facet%20id%202%2C%20hide%20facet%20children.%0A%09if%20(%202%20%3D%3D%3D%20%24settings%5B’id’%5D%20)%20%7B%0A%09%09%24settings%5B’children’%5D%20%3D%200%3B%0A%09%7D%20%0A%0A%09return%20%24settings%3B%0A%7D%0A%0Aadd_filter(%20’wp_grid_builder%2Ffacet%2Fsettings’%2C%20’prefix_facet_settings’%2C%2010%2C%201%20)%3B” message=”” highlight=”” provider=”manual”/]