PhantomPWR
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Use Custom Select List To Save Post Category With CRED Form
Started by: PhantomPWR
in: Toolset Professional Support
Problem: Instead of the standard CRED select field, I would like to use a custom select field in my CRED form to choose a taxonomy term I wish to associate with this post. Solution: Use the following template to create your select element: <select name="category"> <option>- Select a model -</option> <wpv-loop> <option value="[wpv-taxonomy-id]">[wpv-taxonomy-title]</option> </wpv-loop> </select> Then update your functions.php file to capture and store the selected term along with the post: //Create a dynamic category by the CRED form. add_action('cred_save_data','func_save_cat_id_for_cred_post',10,2); function func_save_cat_id_for_cred_post($post_id,$form_data) { if ($form_data['id']==6814) { wp_set_post_terms( $post_id, $_POST['category'], 'category', false ); } } Relevant Documentation: https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data |
2 | 5 | 6 years, 7 months ago | ||
Create shortcode to output term id from slug
Started by: PhantomPWR
in: Toolset Professional Support
Problem: Solution: It would need some custom coding to make it happen. We have some recommended list of service providers here: |
3 | 11 | 6 years, 11 months ago |