Filter: bricks/element/builder_setup_query
Filter: bricks/element/builder_setup_query
Section titled “Filter: bricks/element/builder_setup_query”Filters the query arguments used to set up the preview context in the builder (e.g., when “Populate Content” is active).
Parameters
Section titled “Parameters”$query_args(array): Array of arguments passed toWP_Query.$post_id(int): The ID of the template being edited.
Example usage
Section titled “Example usage”add_filter( 'bricks/element/builder_setup_query', function( $query_args, $post_id ) { // Example: If editing a specific template, force a specific post for preview if ( $post_id === 123 ) { $query_args['p'] = 456; $query_args['post_type'] = 'post'; }
return $query_args;}, 10, 2 ); Was this page helpful?