PHP Query Editor for Terms ignores include parameter

Hi,

I’m trying to build a dynamic taxonomy interlinking section in Bricks 2.3.9.

Setup:

  • Query Loop
  • Type: Terms
  • Taxonomy: base_alcoholica
  • PHP Query Editor enabled

My goal is to display only the taxonomy terms selected in an ACF Taxonomy field.

As a simple test, I tried:

return [
‘taxonomy’ => ‘base_alcoholica’,
‘include’ => [1],
‘hide_empty’ => false,
];

However, the Query Loop still returns all terms instead of only the term with ID 1.

I also tried:

$query_vars[‘include’] = [1];
$query_vars[‘hide_empty’] = false;

return $query_vars;

with the same result.

Questions:

  1. Does the PHP Query Editor for a Terms query return the final WP_Term_Query arguments?
  2. Is the ‘include’ parameter supported?
  3. Are the returned query vars merged with Bricks internal query vars?
  4. Is the recommended approach to use the bricks/terms/query_vars filter instead?
  5. What is the recommended way to query an ACF Taxonomy field and display only those selected terms inside a Bricks Terms Query Loop?

Thanks!

Hi Nico,
I just tried it in 2.3.9, 2.3.10 and 2.4 beta 2 and can’t replicate the issue.

My custom taxonomy is “genre,” and the term with ID 14 is “Comedy” (but it works with any other existing term ID, too).

Are you sure you have a term with the ID 1 in base_alcoholica?
You can check the IDs by hovering over the term names:

Hi,

Yes problem solved.

Thanks again!