• I am wondering if there is a way to show something other than the post_title in the select field when displaying a list of items for a “page link” field (for instance).

    Is there a filter to change this?
    The issue I am having is I would like to show an event date as many events share same post_title so all I see in the select field is “post title” over and over again the same thing. I need a unique field to use here.

    If this is possible, or if there is a filter I can use that would be absolutely tremendous. Thank you for your time and your wonderfully useful time saving plugin.

    https://www.ads-software.com/plugins/advanced-custom-fields/

Viewing 1 replies (of 1 total)
  • Thread Starter psperkins

    (@psperkins)

    aaaannnnddd..answered my own question. Well, sort of.

    I am able to get the value inserted if I use the “relationship” field type like so:

    function my_relationship_result( $result, $object, $field, $post )
    {
        // load a custom field from thie $object and show it in the $result
        $edate = get_post_meta($object->ID, '_event_start_date', true);
    
        // add post type to each result
        $result .= '[' . $edate .  ']';
    
        return $result;
    }
    
    add_filter('acf/fields/relationship/result/key=field_52d70c2b4887f', 'my_relationship_result', 10, 4);

    My question is now “is there any way to do this same thing with the ‘page_link’ field type? All I need is the url it seems wasteful to load the entire post object for just a link.

    Thanks again.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Field show something other than post_title’ is closed to new replies.