Hi! i was trying to filter the query from a Relationship Field wich is in a custom taxonomy term
I tried with this -> http://www.advancedcustomfields.com/resources/customize-the-relationship-field-list-query/
function my_acf_result_query( $args, $field, $post )
{
// eg from https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
$args[‘meta_query’] = array(
array(
‘key’ => ‘color’,
‘value’ => ‘blue’,
‘compare’ => ‘NOT LIKE’
)
);
return $args;
}
But because the Relationship Field isnt in a Post , $post doenst bring anything.
The queestion is how to get the current term , term ID within the filterin HOOK.
Thanks
I have this same problem. did you manage to solve it?
Try adding the post_type or the meta_key
$args['meta_query'] = array(
'post_type' => 'your_post_type',
'meta_query' => array(
'key' => 'color',
'value' => 'blue',
'compare' => '!='
)
);
return $args;