Support

Account

Home Forums Backend Issues (wp-admin) relationships query filter post/post_id is null

Helping

relationships query filter post/post_id is null

  • 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 🙂

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘relationships query filter post/post_id is null’ is closed to new replies.