Support

Account

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;
    }