Hi
1. I’m trying to change the $args variable for the relationship query
2. I’m using this code: add_filter(‘acf/fields/relationship/query/name=field’, ‘foo’, 10, 3);
function foo( $args, $field, $post ) { // using latest version 4.X, no 5.X
return $args;
}
3. The $post object contains nothing. Tried “post_id” too, just to make sure – nothing either
4. The function *does* run and changing the $args parameter has impact
Please advise
Thanks!
Hi @eddr
I’ve just tested it on my installation, but couldn’t reproduce the issue. Could you please share the complete code you used? Also, could you please try to reproduce the issue on one of the WordPress’ stock themes (like Twenty Fifteen) with other plugins deactivated? If it disappears, then you can activate the theme and plugins one by one to see which one causes the issue.
Thanks 🙂