Hi !
When creating a Custom Post Type Post, i’d like to have a way to display a Field that let me choose Parent Taxonomy Terms of the Term selected.
So if i have
Home
-One
–Two
–Three
—Four
Have the ability to select Two and Three when creating a Custom Post in Four.
For now, i can just select from all the terms of a custom Taxonomy.
Thanks a lot
François
Something like this would need to be done using custom JavaScript and AJAX. I’m currently working on a project that I’m doing this on. I won’t go into all of the details about the PHP side of things, that’s covered here well here https://codex.wordpress.org/AJAX_in_Plugins, but I can give an example of the type of JS you’ll need to to add. https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/ is the documentation on adding custom JS for ACF.
And some of what I’ve been working on can be found here https://github.com/Hube2/blunt-parametric-search/blob/master/admin/js/admin.js
If you look on line 363 at the function _para_tax_change, this function makes an AJAX request based on a select field that where the names of the taxonomies on the site are listed. The AJAX request returns a list of terms in the taxonomy and updates another select field with the choices.