Filter: bricks/query/loop_object_type
Bricks will use \Bricks\Query::get_loop_object_type() to retrieve the looping iteration’s object type. This static function is used in many places. It plays an important role in many conditions. The possible return object_type should be ‘post’, ‘term’, or ‘user’ only.
// This is the example when Bricks set the object_type in woo cart query, so inside each iteration, it will be treat as a post/product object_typeadd_filter( 'bricks/query/loop_object_type', function( $object_type, $object, $query_id ) { $query_object_type = \Bricks\Query::get_query_object_type( $query_id );
if ( $query_object_type !== 'wooCart' ) { return $object_type; }
return 'post';}, 10, 3 );Was this helpful?
A quick vote and short notes help us improve these docs faster.
Leave a note for us
Please do not include passwords, license keys, or personal data. We store submitted notes to improve the docs.
Thanks for sharing feedback. We're using it to improve these docs.