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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.