Filter: bricks/related_posts/query_vars
Since Bricks 1.3.5 you may manipulate the related posts element query vars before the query is performed like so:
add_filter( 'bricks/related_posts/query_vars', function( $query_vars, $settings, $element_id ) { $query_vars['post_type'] = [ 'post', 'project' ];
return $query_vars;}, 10, 3 );The filter callback receives two arguments:
$query_varsis an associative array used to feed the WP_Query class$settingsis an associative array containing the element settings set in the builder$element_idis a string containing the element ID
Was this page helpful?