Home › Forums › Backend Issues (wp-admin) › Page Link field type › Reply To: Page Link field type
I’m having the same problem with page links and post object fields. I’ve done some testing and it looks like the problem has to do with the ‘post_status’ argument being set to “any” in the the get_pages() query.
I put this line of code into my functions.php to solve the problem until a more formal bugfix is released.
function fix_acf_post_query($args,$field) {
$args[‘post_status’] = ‘publish’;
return $args;
}
add_filter(‘acf/fields/post_object/query’,’fix_acf_post_query’,10,2);
Keep in mind, it’ll restrict your page links to pages that are published.
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.