Home Forums General Issues Post Object search for post/pages Reply To: Post Object search for post/pages

  • Whilst it may not help, you could possibly do something like:

    add_filter('acf/fields/post_object/query/key=field_5f72f88aca170', 'my_acf_fields_post_object_query', 10, 3);
    function my_acf_fields_post_object_query( $args, $field, $post_id ) {
        $args['post_status'] = 'publish';
        return $args;

    This would only show published posts.

    As you can see from the docs, it uses WP_Query

    So unless you can amend how that works to a more exact search, I don’t think it would be possible.