In functions.php
What my sample code should show in admin?
Just simple relationship field. It is not a part of repeater, group, etc.
Thank you, but how to achieve that? My ACF relation field name is “product_accessories”. I would like to show field “product_index” next to title.
I try to check how it works with, but with no success:
add_filter('acf/fields/post_object/result/name=product_accessories', 'my_acf_fields_post_object_result', 10, 4);
function my_acf_fields_post_object_result( $text, $post, $field, $post_id ) {
$text .= ' (' . $post->post_type . ')';
return $text;
}