Problem: I have a Form that creates new posts. I would like to automatically add a specific term to the new post using the Forms API, but the update_post_meta function isn't working as expected.
Solution: Try the wp_set_object_terms function with the Forms API cred_save_data:
wp_set_object_terms( $post_id, 'term-slug', 'taxonomy-slug' );
Relevant Documentation:
https://codex.wordpress.org/Function_Reference/wp_set_object_terms
https://toolset.com/documentation/programmer-reference/cred-api/
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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 2 replies, has 2 voices.
Last updated by hui-suanC 4 years, 9 months ago.
Assisted by: Christian Cox.