Home › Forums › Backend Issues (wp-admin) › Changing dipslay title of linked items in relationship field › Reply To: Changing dipslay title of linked items in relationship field
I found a solution. The issue was with my configuration based on the combination of Trellis/Bedrock/Sage by Roots.
I was putting the above-mentioned code into the setup.php
, but it should go into the filters.php
(duh…). Also, I had to inline the function as such:
add_filter('acf/fields/relationship/result/name=about_team_profiles', function($title, $post, $field, $post_id) {
$first_name = get_field('profile_first_name', $post->ID);
$last_name = get_field('profile_last_name', $post->ID);
$title = $first_name.' '.$last_name;
return $title;
}, 10, 4);
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.