Support

Account

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.