/ grid / query_args
Dit filter wordt aangeroepen voordat de rasterquery wordt uitgevoerd om berichten, termen of gebruikers op te halen.
Het maakt het mogelijk om de query-argumenten van dynamisch te wijzigen WP_Query
, WP_Term_Query
of WP_User_Query
Argument | Type | Omschrijving |
$query_args | array | Bevat vraagargumenten |
$grid_id | geheel getal | Raster-ID |
[pastacode lang=”php” manual=”function%20prefix_query_args(%20%24query_args%2C%20%24grid_id%20)%20%7B%0A%0A%09%2F%2F%20If%20it%20matches%20grid%20id%201%2C%20we%20exclude%20post%20IDs%201%2C2%2C3%2C4.%20%0A%09if%20(%201%20%3D%3D%3D%20%24grid_id%20)%20%7B%20%24query_args%5B’post__not_in’%5D%20%3D%20%5B%201%2C%202%2C%203%2C%204%20%5D%3B%0A%0A%09%7D%0A%0A%09return%20%24query_args%3B%0A%0A%7D%0A%0Aadd_filter(%20’wp_grid_builder%2Fgrid%2Fquery_args’%2C%20’prefix_query_args’%2C%2010%2C%202%20)%3B” message=”” highlight=”” provider=”manual”/]