Filter: bricks/query/force_loop_index
Forces Bricks\Query::get_loop_index() to return a specific value. This is useful for AJAX contexts (like popups) where you need to simulate a specific loop iteration to render correct data or styles.
Parameters
Section titled “Parameters”$index(string|int): The forced loop index. Default is''(empty string), meaning no override.
Example usage
Section titled “Example usage”add_filter( 'bricks/query/force_loop_index', function( $index ) { // Example: Force loop index to 0 return 0;} );Was this helpful?
A quick vote and short notes help us improve these docs faster.
Leave a note for us
Thanks for sharing feedback. We're using it to improve these docs.