Problem:
The issue here is that the user is creating their RFG on the frontend but wanted the title of the RFG to be auto generated.
Solution:
The user had this code below.
add_action('cred_save_data', 'delegate_title_save_data_action', 10, 2); function delegate_title_save_data_action( $post_id, $form_data ){ // if a specific form if ($form_data['id']==35913) { if(!empty($_POST['wpcf-idx_chantier'])){ $idx_chantier = $_POST['cred_post_parent get="wpcf-idx_chantier"']; } $title = $idx_chantier; $slug = sanitize_title($title); wp_update_post(array('ID' => $post_id, 'post_title' => $title, 'post_name' => $slug)); } }
In this user's case they needed to have replace
$idx_chantier = $_POST['cred_post_parent get="wpcf-idx_chantier"'];
with the proper call for the post parent, which would be
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post
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 6 replies, has 2 voices.
Last updated by 5 years, 7 months ago.
Assisted by: Shane.