Yeah, everything pulls in fine on the front end. They’re just sorted by date and nothing I do with this filter seems to have an effect.
I also tried using the name:
add_filter('acf/fields/post_object/query/name=people_involved', 'sort_people', 10, 3);
Yep, tried it with the field’s key (the actual key, not just the name) and adding the priority parameters to the end. Still nothing…
For reference, here’s my current code, where key is the key of the post object field I’m using:
function sort_people( $args ) {
$args['orderby'] = 'menu_order';
$args['order'] = 'ASC';
return $args;
}
add_filter('acf/fields/post_object/query/key=field_5a9f6ea45bfa1', 'sort_people', 10, 3);
Oh. Oops. That was just a remnant of the cutting and pasting I did. It’s there in the code that I’m working with.
Damn. As stupid as that would have been, I was really hoping that was it…
Hey @joelstransky, would you mind sharing the code you used to get an ACF field in the menu structure item? I’m trying to add a field in there myself and it would be hugely helpful if I could just use ACF to do it.
Did you ever figure this out? I’m currently struggling with the same thing…
For anyone having trouble with this same thing, the prefix seems to be back to “fields”, so the original code is currently working for with (ACV v 4.3.9)