added change card prof 5€

This commit is contained in:
asus
2024-04-09 20:02:03 +02:00
parent ec9bddaefd
commit db4cd0ad55
9 changed files with 169 additions and 118 deletions

View File

@@ -10,6 +10,27 @@ if (!defined('ABSPATH')) {
/*
* action to be done at the init state of the page
*
*/
function prof_payment_page_init_CIPF() {
Plgntls::debug_infos(2);
if (!is_prof_CIPF()) {
return;
}
Plgntls::debug_infos();
// https://developer.wordpress.org/reference/functions/get_query_var/#more-information
global $wp;
$wp->add_query_var('prof_card_change');
}
add_action('init','prof_payment_page_init_CIPF');
/*
@@ -29,7 +50,18 @@ function payment_page_checks_CIPF() {
// get the user id
$user_id = get_current_user_id();
// do checks here
/*
* check for query card change
* and modify acf field accordingly
*
*/
$is_card_change = get_query_var('prof_card_change', false);
if ($is_card_change == true) {
set_acf_prof_change_card_CIPF();
}
else {
reset_acf_prof_change_card_CIPF();
}
}
add_action('wp', 'payment_page_checks_CIPF');
@@ -37,6 +69,8 @@ add_action('wp', 'payment_page_checks_CIPF');
/*
* only profs can access this page
*