Thank you for your help, "case number" I processed with post_id~
Also ask a cred_save_data question:
I have completed the following code:
<?php
//After sending out the application form, let "Process Progress" become "Send In".
add_action('cred_save_data','func_custom_processing_progress',10,2);
function func_custom_processing_progress($post_id,$form_data) {
if ($form_data['id']==9999) {
$args = array('processing_progress' => '1');
wp_update_post($args);
}
}
?>
After the form is sent, I automatically change the "Processing Progress" field to the "Send in" option, but I don't know where to put it in the post form. Is it in the JS editor? ?
In addition, the field slug of my "processing progress" is "processing-progress". The option "Send in" option is "1". Can this code be work?
Ok - As I understand you want to update the value of custom field "processing-progress" after user submit the form. Types custom field stored in postmeta table.
So you need to use the following code:
//After sending out the application form, let "Process Progress" become "Send In".
add_action('cred_save_data','func_custom_processing_progress',10,2);
function func_custom_processing_progress($post_id,$form_data) {
if ($form_data['id']==9999) {
update_post_meta($post_id,'wpcf-processing-progress',1);
}
}
If I want to update today's date to wpcf-date-delivery, can I use the following code?
//After sending out the application form, let "Process Progress" become "Send In".
add_action('cred_save_data','func_custom_processing_progress',10,2);
function func_custom_processing_progress($post_id,$form_data) {
if ($form_data['id']==214) {
update_post_meta($post_id,'wpcf-processing-progress',1);
update_post_meta($post_id,'wpcf-date-delivery',today());
}
}
Also ask:
I have a registration form , Userid input phone number.
I have a custom field is "mobile".
I want to update userid to mobile,when user registration form subitted.
Is this code correct to what I want?
add_action('cred_save_data','userid_update_to_mobile',10,2);
function userid_update_to_mobile($post_id,$form_data) {
if ($form_data['id']==9999) {
$user_id => get_userdata( $user_id )
update_post_meta($post_id, 'wpcf-mobile', $user_id);
}
}
Well - we can not continue this way, as per our support policy we answer only one question per ticket as this will help other users searching on the forum and to write correct resolve ticket summary.
May I kindly ask you to open a new ticket with your each new question. This will help other users searching on the forum.
Even you can create a new ticket and assign it to me.