/ facet / query_objects
Dit filter wordt aangeroepen voordat een facet object-id's (post-id's, term-id's of gebruikers-id's) uit geselecteerde facetwaarde (n) opvraagt.
Het laat toe om het gedrag van de inboorling te negeren query_objects
methode van het facet en om aangepaste object-id's door te geven om de gefilterde inhoud te wijzigen.
Argument | Type | Omschrijving |
$object_ids | gemengd | Matrix met object-ID's (standaard false) |
$facet | array | Bevat facetinstellingen |
[pastacode lang=”php” manual=”function%20prefix_query_objects(%20%24object_ids%2C%20%24facet%20)%20%7B%0A%0A%09%2F%2F%20If%20it%20matches%20facet%20id%201%2C%20we%20set%20a%20custom%20set%20of%20post%20ids.%20%0A%09if%20(%201%20%3D%3D%3D%20%24facet%5B’id’%5D%20)%20%7B%20%0A%09%09%24object_ids%20%3D%20%5B%201%2C%2020%2C%2034%2C%20105%20%5D%3B%0A%09%7D%20%0A%0A%0A%09%2F%2F%20If%20it%20matches%20facet%20id%202%2C%20we%20make%20a%20custom%20query%20from%20selected%20facet%20values.%20%0A%09if%20(%202%20%3D%3D%3D%20%24facet%5B’id’%5D%20)%20%7B%20%0A%09%09%24object_ids%20%3D%20my_custom_query(%20%24facet%5B’selected’%5D%20)%3B%20%0A%09%7D%20%0A%0A%0A%0A%09%2F%2F%20Return%20false%20by%20default.%20%0A%09return%20%24object_ids%3B%0A%09%0A%7D%0A%0Aadd_filter(%20’wp_grid_builder%2Ffacet%2Fquery_objects’%2C%20’prefix_query_objects’%2C%2010%2C%202%20)%3B” message=”” highlight=”” provider=”manual”/]