Home › Forums › Add-ons › Repeater Field › Browse in repeater for post object › Reply To: Browse in repeater for post object
I hate to admit it, but my filter at present is just this:
<?php
function my_acf_relationship_result( $html, $post )
{
// add an image to each result
$image = get_field('thumbnail', $post->ID);
$date = get_the_date();
if( $image )
{
$html = '<img src="' . $image['url'] . '" />' . $html;
}
return $html . ' ' . $date;
}
// acf/fields/relationship/result - filter for every field
add_filter('acf/fields/relationship/result', 'my_acf_relationship_result', 10, 2);
?>
and I’ve edited core/fields/relationship.php to change the sort order.
Not ideal, I know, but I needed it to work quickly.
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.