Support

Account

Home Forums Backend Issues (wp-admin) Show Custom Fields in Post Object Dropdown

Helping

Show Custom Fields in Post Object Dropdown

  • I have an Event custom post type where the same dozen or so post titles are used each year. I also have a Photo Gallery custom post type, and I want to associate Photo Galleries with Events, so I’ve got a post object field on the Photo Galleries edit page.

    The trouble is that I can’t tell two or three posts from different years apart because they have the same title. Is there a way to show a custom field value (the ‘event_date’ for the post) next to the title in the Select2 dropdown?

  • Hi @matthewmcvickar

    Thanks for the post.

    To do this, you will need to hook into the acf/fields/post_object/result filter and modify the text displayed for each option in the post object field.

    This is explained further here: https://www.advancedcustomfields.com/resources/acf-fields-post_object-result/

    I hope this info helps.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.