Tell us what you are trying to do?
- I have a front-end form the creates a custom post type post.
- Form submission creates a post in "Pending" status.
- This custom post type has a checkbox field with some preset data.
- I also have another text field created for other data, no available from pre-made checklist field.
- I want after form submission and turning the created post into "published" status to have a value from a text field picked-up and added to the pre-set checkbox field on the admin side (not on the front-end).
For example:
Let's say I have a checkbox field "City" with a list of cities: Paris, London, Madrid. Cities are added on the admin side on the custom field level. And I have a text field "Other city" where the user can add a city, not from the list.
So if user add a city "Deli" to the text field "Other city" I would like after created post is getting a "publish" status to have a custom field checkbox field "City" update with a "Deli" city.
This way I could increase an autonomy of the custom post creation as website administrators wouldn't have to manually pickup new cities and add them to the custom field.
Do you think it is possible?
Is there any documentation that you are following?
- Unfortunately, I couldn't find any
Is there a similar example that we can see?
- Unfortunately, I couldn't find any
Hello. Thank you for contacting the Toolset support.
Checkboxes fields are special fields and the value of checkboxes fields are stored as serialized array into database.
There is no such option to add checkboxes options dynamically that as per your requirement if X city is added to textbox "other field" when you publish the post the X city added as checkboxes option.
You can simply show/hide the "Other Field" value based on post status.