Home › Forums › Feature Requests › Display relationship objects custom fields in relationship search › Reply To: Display relationship objects custom fields in relationship search
Hi Elliot,
thanks for your answer.
I’m not an expert with jQuery, so by now I found this solution:
In relationship.php I duplicated the featured_image code in the loop and added:
if( in_array('code', $field['result_elements']) )
{
$code = get_field( 'code' );
$title .= '<span class="code">' . $code . '</span> ';
}
and then in right list:
if( in_array('code', $field['result_elements']) )
{
$code = get_field( 'codice', $p->ID );
$title .= '<span class="code">' . $code . '</span> ';
}
and in the choices array I added:
'code' => __("Code",'acf'),
In this way it works perfectly (as shown in the screenshot).
Is it possible to do the same with a hook or filter in functions.php, so I leave your file unchanged and update friendly?
Regards,
Davide
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.