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 ) {
    if ( isset( $settings['ignoreStickyPosts'] ) ) {
        $query_vars['ignore_sticky_posts'] = 1;
    }

    return $query_vars;
}, 10, 2 );

The filter callback receives two 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

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

×