- added debug function
- fixed issues in acf fields use
This commit is contained in:
@@ -20,6 +20,7 @@ if (!defined('ABSPATH')) {
|
||||
*
|
||||
*/
|
||||
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;
|
||||
@@ -48,6 +49,7 @@ function reset_some_fields_CIPF() {
|
||||
*
|
||||
*/
|
||||
function renew_page_restrictions_CIPF(){
|
||||
PLGNTLS_class::debug_infos();
|
||||
$slug_renew_card = PLGNTLS_class::SLUG_RENEW_CARD;
|
||||
$slug_page_redirection = PLGNTLS_class::SLUG_PAGE_REDIRECTION;
|
||||
$acf_prof_can_renew = PLGNTLS_class::ACF_PROF_CAN_RENEW;
|
||||
@@ -79,7 +81,7 @@ function renew_page_restrictions_CIPF(){
|
||||
*
|
||||
*/
|
||||
if (current_user_can('professeur__professeure')) {
|
||||
$can_renew = get_field($acf_prof_can_renew, $acf_id);
|
||||
$can_renew = get_field($acf_prof_can_renew['_name'], $acf_id);
|
||||
if ($can_renew === false) {
|
||||
$redirect_url = home_url() . '/' . $slug_page_redirection;
|
||||
wp_redirect($redirect_url, 301);
|
||||
@@ -110,6 +112,7 @@ add_action('template_redirect', 'renew_page_restrictions_CIPF');
|
||||
*
|
||||
*/
|
||||
function renew_page_filter_message_CIPF(){
|
||||
PLGNTLS_class::debug_infos();
|
||||
$slug_renew_card = PLGNTLS_class::SLUG_RENEW_CARD;
|
||||
$acf_card_state = PLGNTLS_class::ACF_CARD_STATE;
|
||||
|
||||
@@ -122,8 +125,6 @@ function renew_page_filter_message_CIPF(){
|
||||
$cipf_renew = new PLGNTLS_class();
|
||||
|
||||
$card_state = get_field($acf_card_state['_name'], $acf_id);
|
||||
error_log("card_state");
|
||||
error_log($card_state);
|
||||
|
||||
if ($card_state === 'Renouvellement') {
|
||||
$cipf_renew->add_to_front(array(
|
||||
|
||||
Reference in New Issue
Block a user