Skip to content
Get Bricks

Filter: bricks/query/run_fake

Defines the results of a “fake” query execution for custom or unsupported query types. This is used when calculating filter counts or other logic that requires querying all potential results without pagination.

  • $results (array): The query results array (default []).
  • $query (object): The Bricks Query instance.
add_filter( 'bricks/query/run_fake', function( $results, $query ) {
// Example: Provide all results for a custom 'my_api' query type
if ( $query->object_type === 'my_api' ) {
// Fetch all IDs from your API
return [ 1, 2, 3, 4, 5 ];
}
return $results;
}, 10, 2 );