Filter: bricks/query/result_end
The bricks/query/result_end filter changes the numeric ending position stored in $query->end. Query Results Summary reads this value for its %end% placeholder.
This filter changes summary metadata only. It does not change the returned items, skip the first item, limit the rendered cards, change the total count, or fetch another page.
Parameters
Section titled “Parameters”$end(int): The current ending result position. Native post, term, and user queries normally calculate one-based positions. The value can be0when no range has been populated, including in provider-backed ACF loops.$query(Bricks\Query): The query instance. Use its public$element_idproperty to scope the filter to a specific loop element.
Example usage
Section titled “Example usage”This example sets the ending position reported for a specific loop to 3. It changes only the summary number; it does not limit the loop to three items.
Replace abc123 with the loop element’s raw Bricks ID, without the brxe- prefix or a #.
add_filter( 'bricks/query/result_end', function( $end, $query ) { if ( $query->element_id === 'abc123' ) { // Adjust the summary's ending position only. return 3; }
return $end;}, 10, 2 );For example, if an ACF Relationship loop returns four items, returning 3 here still renders all four in their original order. The total count remains 4, and no additional page is fetched.
Change the actual results
Section titled “Change the actual results”Use the Query Loop controls for native query limits and offsets, or bricks/query/result to modify fetched results.
For an ACF loop that returns an array, a result filter scoped to the loop element can use array_slice() to skip or limit items. This changes the returned array while preserving the saved ACF entries and the editorial order of the retained items. See the ACF array example.
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.