Home › Forums › Backend Issues (wp-admin) › Limit results in filter post_object query › Reply To: Limit results in filter post_object query
I just ran into this issue whereby filtering a post_object’s query wasn’t taking, but it looks like when a post_object’s type is ‘page’, ACF is effectively firing get_pages vs. creating a new WP_Query, so the args are all different.
So, running this choked:
$args['post_parent'] = $parent->ID; $args['orderby'] = 'menu_order';
While running this works great:
$args['child_of'] = $parent->ID; $args['sort_column'] = 'menu_order';
Hopefully this will help anyone else who’s wondering why this isn’t working properly.
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.