Home › Forums › ACF PRO › Post Objects Post Title in a Relationship Filter refuses to display › Reply To: Post Objects Post Title in a Relationship Filter refuses to display
See my changes
add_filter('acf/fields/relationship/result/name=show_as_community_model', 'my_acf_fields_relationship_result', 10, 5);
function my_acf_fields_relationship_result( $text, $post, $field, $post_id ) {
$community = get_field ('community', $post->ID);
$sqft = get_field('sq_ft', $post->ID);
$mls = get_field('mls', $post->ID);
$price = get_field('price',$post->ID);
if ($post->post_type == 'home_listings') {
$text .= ' • Community: ' . $community->post_title . ' • Lot: ' . $lot . ' • SqFt: ' . $sqft . ' • MLS: ' . $mls . ' • Price: ' . $price . '';
}
return $text;
}
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.