Home Forums General Issues Allow/Save Custom to an actual post type?


Allow/Save Custom to an actual post type?

  • I’ve added a field of checkbox type with the option to add new custom values and the option to save the new option to the field’s choices.

    But how do I also save that newly added option to an actual custom post type I’ve created?

    Could I also somehow have the Choices be coming from an actual custom post type instead of having to specify them manually in the interface (option : option)?

  • @blaasvaer

    Hi there…

    A potentially different way to tackle it would be to:

    a) Use a Select field

    b) Have an Option Page (here’s an Admin Tool to create Option Pages for ACF) with the default choices

    c) Dynamically populate the select field’s choices with values from the Option Page (and sort them even)

    d) Offer an ‘Other’ text box for when the choice is unavailable in the Select

    e) Any time someone uses Other… add it to the default choices, add it as the value in the Select field, clear the Other field (using a ‘save’ filter)

    I did this very thing for a horse race track website and it works beautifully (see attached images). The user chooses who he feels will win the races. To save him time, he chooses the horse from the drop-down (which pulls its values direct from a field in an Option Page)… but uses the “Other” text box when needed. My logic also makes sure there are no duplicates when he uses the “Other” box.

    If this works for you, please mark as closed, or reach out if you need further help!

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

You must be logged in to reply to this topic.