Filter: bricks/query/force_is_looping
Filter: bricks/query/force_is_looping
Section titled “Filter: bricks/query/force_is_looping”Forces Bricks\Query::is_looping() to return true. This is useful in AJAX contexts (like popups) where you need to simulate being inside a query loop to correctly render dynamic data that depends on the loop context.
Parameters
Section titled “Parameters”$force(bool): Whether to force the is_looping state. Default isfalse.$query_id(string): The ID of the query being checked.$element_id(string): The ID of the element being checked.
Example usage
Section titled “Example usage”add_filter( 'bricks/query/force_is_looping', function( $force, $query_id, $element_id ) { // Example: Force looping for a specific element ID if ( $element_id === 'my_element_id' ) { return true; }
return $force;}, 10, 3 ); Was this page helpful?