Support

Account

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);