I have created a custom post type (slug="knowledge") with a connected a field group. All custom fields are stored in a custom table.
One of the custom fields is called "Info Source" with the ID "kb_infosource" (which also is the name of the table column). The type of this field is Taxonomy Advanced. And it is connected to the custom taxonomy "KB Info Source" with the slug "kb-infosource".
Now I want to find all knowledge posts which have the "KB Info Source" term name "Report" (slug=report-sso; id=202, the id is the value stored in the custom table column). I have tried this (besides a tax_query):
$args = array(
'post_type' => 'knowledge',
'meta_key' => 'kb_infosource',
'meta_query' => array(
array(
'key' => 'kb_infosource',
'value' => 202,
'compare' => '=',
),
),
);
$query = new WP_Query( $args );
But this doesn't work (but otherwise it works fine to filter with a facet created with WP GridBuilder). I guess I miss something simple.