I have 6 separate "regional" taxonomies. (Continents, Countries, National Divisions, Divisional Regions, Major Civil Divisions, Minor Civil Divisions).
When a user is submitting content, I want them to choose a value in each of these 6 taxonomies. However I would like them to display conditional values.
For example if the user chooses "North America" under the continent taxonomy, I would like only North American Countries to be available under the Countries Taxonomy, and continue on down the line through all 6 Taxonomies.
I am open to setting this up a different way, I have custom post types set up that match the 6 taxonomies and their values as well.
Thanks in advance,
Brad - leaftraders.com
Hi Brad,
Thank you for contacting us and I'll be happy to assist.
Unfortunately, the CRED form doesn't support such conditional filtering and this will require custom programming.
Although 1-1 custom programming of this extent is beyond the scope of support that we provide, following points should help:
1. Since taxonomies cannot be linked together with each other, I'll suggest to remove them and use custom post types for segmentation ( i.e. Continents, Countries, National Divisions, Divisional Regions, Major Civil Divisions & Minor Civil Divisions will all have a custom post type of their own ).
2. You'll be able to link these custom post types using relationships, as explained in this guide:
https://toolset.com/documentation/post-relationships/
3. In your CRED form, you can add generic fields and then populate their options, using AJAX calls and Select2 script library.
Following are some useful resources on these topics:
https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/
https://codex.wordpress.org/Plugin_API/Action_Reference/wp_ajax_(action)
hidden link
4. As the last step, you'll be able to process and save the submitted data from this form using the CRED form's "cred_submit_complete" hook, as needed.
https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete
For a personalized and detailed assistance around custom programming, you can consider hiring, one of our certified consultants:
https://toolset.com/contractors/
I hope this helps.
regards,
Waqar
My issue is resolved now. Thank you!