wip account states

This commit is contained in:
asus
2024-03-19 07:28:17 +01:00
parent e1f4799150
commit 0b8b479584
4 changed files with 21 additions and 9 deletions

View File

@@ -12,15 +12,21 @@ if (!defined('ABSPATH')) {
/*
* when form is validated, reset some fields
* when form is validated
* - reset some fields
* - change account state
*
*/
function prof_form_reset_fields_CIPF($form_id, $post_array, $form_type) {
PLGNTLS_class::debug_infos();
$acf_cgv = PLGNTLS_class::ACF_PROF_CGV;
$acf_account_state = PLGNTLS_class::ACF_ACCOUNT_STATE;
$user_id = get_current_user_id();
update_field($acf_cgv['_name'], array(""), 'user_'.$user_id);
$acf_id = 'user_'.$user_id;
update_field($acf_cgv['_name'], array(""), $acf_id);
update_field($acf_account_state['_name'], $acf_account_state['to_pay'], $acf_id);
}
//add_action('df_before_process', 'prof_form_reset_fields_CIPF', 10, 3);
add_action('df_after_process', 'prof_form_reset_fields_CIPF', 10, 3);