Problem:
The issue here is that the user wanted to create a custom post title from their custom fields.
Solution:
This can be done by using the Hook below as an example
add_action('cred_save_data','func_custom_post_title',10,2); function func_custom_post_title($post_id,$form_data) { if ($form_data['id']==XXXX) { $field_1 = $_POST['wpcf-field-slug-1'] $field_2 = $_POST['wpcf-field-slug-2'] $args = array('ID' => $post_id, 'post_title' => $field_1.' '.$field_2); wp_update_post($args); } }
Now in this user's case we are using 2 custom fields as you can see from teh $field_1 and $field_2 variable.
Add this to your toolset custom code in Toolset -> Settings -> Custom code and then activate it.
Notice you must change the XXXX to the ID of your form.
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 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 14:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Jamaica (GMT-05:00)
This topic contains 4 replies, has 2 voices.
Last updated by 5 years, 8 months ago.
Assisted by: Shane.