Home › Forums › Feature Requests › Filtering acf_get_posts args › Reply To: Filtering acf_get_posts args
The issue is because there’s no way to pass a custom array of
$args into the
acf_get_posts() function from the
acf_field_post_object::get_posts() method as there are no filters in this method and it’s being called by
That’s why the snippet in my original post suggests adding the three filters so this can be adjusted if we need to do so.
The post status adjustment in
acf/fields/post_object/query is to allow the AJAX search to search for that specific post status, otherwise again it uses
any which will miss out my custom
archived status. This section works perfectly, the issue comes when the field is then rendered on page load using
acf_field_post_object::render_field() which comes back as blank.
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’re hard at work on ACF 6.1, and Beta 1 is now available 🚀— Advanced Custom Fields (@wp_acf) March 16, 2023
This release includes custom post type and taxonomy registration, an improved experience when selecting field types, PHP 8.1 and 8.2 compatibility, and more!
Let’s take a look 🧵https://t.co/Y0WcAT11l4
© 2023 Advanced Custom Fields.