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 helpful?
A quick vote and short notes help us improve these docs faster.
Leave a note for us
Please do not include passwords, license keys, or personal data. We store submitted notes to improve the docs.
Thanks for sharing feedback. We're using it to improve these docs.