- moved reset field function outside renew_card file
- created a patch for formbuilder calculation pbm
This commit is contained in:
@@ -10,32 +10,6 @@ if (!defined('ABSPATH')) {
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* reset some fields for the form to buy the card
|
||||
* - cgv
|
||||
* - paiement
|
||||
* - livraison
|
||||
* - tarif
|
||||
* this action is called if no redirection happens
|
||||
*
|
||||
*/
|
||||
function reset_some_fields_CIPF() {
|
||||
PLGNTLS_class::debug_infos();
|
||||
$acf_cgv = PLGNTLS_class::ACF_PROF_CGV;
|
||||
$acf_payement = PLGNTLS_class::ACF_CARD_PAYMENT_METHOD;
|
||||
$acf_delivery = PLGNTLS_class::ACF_CARD_PRICE_DELIVERY;
|
||||
$acf_price = PLGNTLS_class::ACF_CARD_PRICE_CHOICE;
|
||||
|
||||
$user_id = get_current_user_id();
|
||||
update_field($acf_cgv['_name'] , array(""), 'user_'.$user_id);
|
||||
update_field($acf_payement['_name'], array(""), 'user_'.$user_id);
|
||||
update_field($acf_delivery['_name'], array(""), 'user_'.$user_id);
|
||||
update_field($acf_price['_name'] , array(""), 'user_'.$user_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* on renew page :
|
||||
@@ -91,12 +65,6 @@ function renew_page_restrictions_CIPF(){
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* if prof can renew its card, reset some form fields before
|
||||
*
|
||||
*/
|
||||
reset_some_fields_CIPF();
|
||||
}
|
||||
add_action('template_redirect', 'renew_page_restrictions_CIPF');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user