updates acf fields const values in class to avoid errors

This commit is contained in:
asus
2024-03-08 17:57:04 +01:00
parent 789a361871
commit fc3a205359
10 changed files with 173 additions and 67 deletions

View File

@@ -21,7 +21,7 @@ function handle_prof_is_activ_CIPF($author_id) {
* if prof is activ, do nothing more
*
*/
$is_activ = get_field($acf_prof_is_activ, $acf_id);
$is_activ = get_field($acf_prof_is_activ['_name'], $acf_id);
if ($is_activ === 'Actif')
return;
@@ -51,7 +51,7 @@ function handle_prof_is_activ_CIPF($author_id) {
/*
* check meta field 'cipf_payement_status'
* check meta field META_PAYEMENT_STATUS
* if field value is 'success'
* - hide block 'failure'
* - and update field to '', so it will not show next time
@@ -68,13 +68,15 @@ function handle_prof_is_activ_CIPF($author_id) {
*
*/
function show_prof_paiement_messages_CIPF($user_id) {
$acf_prof_is_activ = PLGNTLS_class::ACF_PROF_IS_ACTIV;
$meta_payement_status = PLGNTLS_class::META_PAYEMENT_STATUS;
/*
* if prof is inactive, do nothing more
*
*/
$acf_prof_is_activ = PLGNTLS_class::ACF_PROF_IS_ACTIV;
$acf_id = 'user_' . $user_id;
$is_activ = get_field($acf_prof_is_activ, $acf_id);
$is_activ = get_field($acf_prof_is_activ['_name'], $acf_id);
if (is_null($is_activ) || empty($is_activ))
return;
if ($is_activ === 'Inactif')
@@ -82,8 +84,7 @@ function show_prof_paiement_messages_CIPF($user_id) {
$cipf_prof_payement = new PLGNTLS_class();
$payement_status2 = get_user_meta($user_id, 'cipf_payement_status');
$payement_status = get_user_meta($user_id, 'cipf_payement_status', true);
$payement_status = get_user_meta($user_id, $meta_payement_status, true);
if ($payement_status === 'success') {
$cipf_prof_payement->add_to_front(array(
array( 'css' => '#cipf_prof_paiement_reussi {display: block;}' )
@@ -95,7 +96,7 @@ function show_prof_paiement_messages_CIPF($user_id) {
));
}
update_user_meta($user_id, 'cipf_payement_status', '');
update_user_meta($user_id, $meta_payement_status, '');
}