Home › Forums › Front-end Issues › acf/fields/post_object/query filter not working on the frontend? › Reply To: acf/fields/post_object/query filter not working on the frontend?
Have you tried specifying a field by name or key? Also, the two numbers that are at the end are missing from your code line. Not sure if they’re optional:
add_filter('acf/fields/post_object/query', 'sort_people');
// filter for a specific field based on it's name
//add_filter('acf/fields/post_object/query/name=my_post_object', 'my_post_object_query', 10, 3);
// filter for a specific field based on it's key
//add_filter('acf/fields/post_object/query/key=field_508a263b40457', 'my_post_object_query', 10, 3);
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!
✨ You can now install ACF PRO with Composer, eliminating the need for third-party installers. Get the details and instructions here. https://t.co/ebEfp60Pwj
— Advanced Custom Fields (@wp_acf) February 2, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.