Consider this scenario:
CPT: job
Taxonomy: industry
Custom field: job_visibility of type Radio with a default value of public. The other value is private.
Requirement: Show the industries associated with jobs for which job visibility is public.
This Pro tutorial shows how.
Let’s look at this sample data:

After implementing the tutorial, the terms output will be Construction and Pharmaceutical.
“Job Fields” field group created with Meta Box (custom fields plugin does not matter for this tutorial, the same can be done with ACF as well):

Step 1
Enable query loop on a Block in the Bricks editor and select the query type of Terms.
Select your taxonomy.

Add a Heading or Basic Text element inside the query-loop Block having:
{term_name}
This will output all the terms of the selected taxonomy.
Step 2
Add the following in child theme‘s functions.php (w/o the opening PHP tag) or a code snippets plugin:
<?php
add_filter( 'bricks/terms/query_vars', function( $query_vars, $settings, $element_id ) {
if ( $element_id !== 'hhouxb' ) {
return $query_vars;
}
// Get all jobs that are not private
$jobs_query = new WP_Query( [
'post_type' => 'job', // set your post type here
'posts_per_page' => -1,
'meta_query' => [
'relation' => 'AND',
[
'key' => 'job_visibility', // your custom field name/ID/key
'value' => 'public',
'compare' => '==',
],
[
'key' => 'job_visibility', // your custom field name/ID/key
'compare' => 'EXISTS',
]
],
'fields' => 'ids', // Only get post IDs
] );
$query_vars['object_ids'] = $jobs_query->posts;
return $query_vars;
}, 10, 3 );
Replace hhouxb with the Bricks ID of the query loop-enabled Block.
[Bonus] Step 3
Under each term, if you want to show a count of posts for which the post meta is a certain value implement this step.
In this case, we want to show a count of all the jobs that are public under each industry.
For this, we can define a custom function like this:
function bl_get_public_jobs_count(): int {
$jobs_query = new WP_Query( [
'post_type' => 'job',
'posts_per_page' => -1,
'meta_query' => [
'relation' => 'AND',
[
'key' => 'job_visibility',
'value' => 'public',
'compare' => '==',
],
[
'key' => 'job_visibility',
'compare' => 'EXISTS',
]
],
'fields' => 'ids', // Only get post IDs
'tax_query' => [
[
'taxonomy' => 'industry',
'terms' => BricksQuery::get_loop_object()->term_id
]
]
] );
return count( $jobs_query->posts );
}
Whitelist the bl_get_public_jobs_count function.
Ex.:
<?php
add_filter( 'bricks/code/echo_function_names', function() {
return [
'bl_get_public_jobs_count'
];
} );
You should also add other functions (native or custom) being used in your Bricks instance besides bl_get_public_jobs_count. This can be checked at Bricks → Settings → Custom code by clicking the Code review button.
More info on whitelisting can be found here.
To display the count:
{echo:bl_get_public_jobs_count}