Home › Forums › General Issues › Set Child Category › Reply To: Set Child Category
This isn’t possible with the existing conditional logic, however, it could be built using what is available.
Instead of using a taxonomy field for the “Parent” category, or depending on the “Category” box, you can use a select field and then dynamically fill the select field with only top level terms. http://www.advancedcustomfields.com/resources/dynamically-populate-a-select-fields-choices/
Allow your select field to have a null value and then display the text field to enter a child field if the select field value is empty.
Then create an acf/save_post filter that adds the category and adds the term to the post: http://www.advancedcustomfields.com/resources/acfsave_post/
I’m sure there will be a lot of little things that you also need to deal with that I haven’t thought about.
You could also include a radio button that asks “Add new sub-cagegory?” and if the user selects yes then show the “Parent” category select field and the text box for adding the sub-category.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.