Support

Account

Home Forums Backend Issues (wp-admin) How to add content from date field to select list?

Helping

How to add content from date field to select list?

  • I have seen some similar questions so I hope that this is possible. Let’s say I have a website for a small theater. Each crew member has his/her own page with a list of plays he/she was participating – each play has a date when it was first performed.

    So on the actor’s page backend I have a list (repeater field) where I can chose from all plays (post object) ever performed. The problem: The select list only shows the plays’ names, but not the date when they were first performed. So it is almost impossible for the editor to sort that list chronologically. Currently the select list look like this:

    —–
    A Hobbit’s tale
    Beware of the thief
    Cesar calling
    —–

    So – is there a way to add the content from the date field to the select list so that it would look similar to this?

    —–
    A Hobbit’s tale (2007)
    Beware of the thief (2003)
    Cesar calling (2009)
    —–

    thank you!
    best regards
    t

  • Hi @tille

    ACF has a handy filter that would help in addressing this requirement.

    Please take a look at the usage of the acf/fields/post_object/results filter on this page for more info: https://www.advancedcustomfields.com/resources/acf-fields-post_object-result/

    Hope this helps 🙂

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

You must be logged in to reply to this topic.