All Topics
Query for inline editing of ACF relationship fields
Hello!
is it possible to limit the selectable options when inline editing ACF relationship fields?
For example, I have an ACF relationship field that is restricted to top level posts only. This is done by using an ACF filter like this:
add_filter( ‘acf/fields/relationship/query/name=my_relationship_field_name’,’my_relationship_options_filter’, 10, 3);
function my_relationship_options_filter($options, $field, $the_post) {
$options[‘post_parent’] = 0;
return $options;
}
Unfortunately, child posts are still selectable when inline editing this ACF relationship field.
Is there any way to restrict it to top level posts as well, so that child posts are not selectable anymore?
You must be logged in to reply to this topic.