Home › Forums › Backend Issues (wp-admin) › Limit results in filter post_object query › Reply To: Limit results in filter post_object query
I have a similar is issue when trying to do this:
function my_post_object_query( $args, $field, $post )
{
// filter by the posts current categories
$args['cat'] = implode(",", wp_get_post_categories($post->ID));
echo "<pre>";
print_r($args);
echo "<pre>";
return $args;
}
add_filter('acf/fields/post_object/query/key=field_524f02159316d', 'my_post_object_query', 10, 3);
The category filter is not picked up… same as above, the post_object.php is using get_pages() against a custom post type.
Suggestions other then changing the core file?
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.