Problem:
The user would like to assign some taxonomy terms, to a post created using a Toolset form, automatically.
Solution:
The code that you shared seems to create a Reg User post. If you want to create a taxonomy term, you will need to use the function wp_insert_term. And if you want to assign the taxonomy term to the post, you can use the wp_set_object_terms function.
To get the value of the field, use the get_post_meta function or you can use the $_POST array data. You may need to add the wpcf- prefix to the field slug.
I hope this helps. Check this ticket for inspiration https://toolset.com/forums/topic/adding-taxonomy-programatically/
Relevant Documentation:
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - | - | 9:00 – 13:00 |
14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - | - | 14:00 – 18:00 |
Supporter timezone: Africa/Casablanca (GMT+01:00)
This topic contains 2 replies, has 2 voices.
Last updated by 3 years, 11 months ago.
Assisted by: Jamal.