Filter: bricks/terms/query_vars

Bricks terms query variables can be manipulated before the query runs like so:

add_filter( 'bricks/terms/query_vars', function( $query_vars, $settings, $element_id ) {
    $query_vars['exclude'] = 23; // Exclude term id 23

    return $query_vars;
}, 10, 3 );

The filter callback receives three arguments:

  • $query_vars an associative array used to feed the WP_Term_Query class
  • $settings an associative array containing the element settings set in the builder
  • $element_id is a string containing the unique element ID