Home Forums General Issues Use value from field in another group Reply To: Use value from field in another group

  • I’ve found this and it works fine. The field donations is a Post Object field and in functions.php I’ve added this code:


    function my_post_object_result( $title, $post, $field, $post_id ) {

    // load a custom field from this $object and show it in the $result
    $page_views = get_field(‘achternaam’, $post->ID);

    // append to title
    $title .= ‘ [‘ . $page_views . ‘]’;

    // return
    return $title;


    // filter for every field
    add_filter(‘acf/fields/post_object/result’, ‘my_post_object_result’, 10, 4);


    One more question though.. when I fill in the field Donation I can only search on post_id, not on the custom field.

    Any ideas?