Filter: bricks/posts/query_vars

Since Bricks 1.3.2 you may manipulate the posts and products elements query vars before the query is performed like so:

add_filter( 'bricks/posts/query_vars', function( $query_vars, $settings, $element_id ) {
    if ( isset( $settings['ignoreStickyPosts'] ) ) {
        $query_vars['ignore_sticky_posts'] = 1;

    return $query_vars;
}, 10, 3 );

The filter callback receives three arguments:

  • $query_vars an associative array used to feed the WP_Query class
  • $settings an associative array containing the element settings set in the builder
  • $element_id is a string containing the unique element ID (since Bricks 1.3.6)

To add new controls to the posts or products elements use the filter bricks/elements/{element_name}/controls