on row, added display none in page css * #cipf_prof_paiement_reussi -> on row * #cipf_prof_paiement_echoue -> on row * */ //function show_prof_paiement_messages_CIPF($user_id) { // PLGNTLS_class::debug_infos(); // $acf_prof_is_activ = PLGNTLS_class::ACF_PROF_IS_ACTIV; // $acf_payment_status = PLGNTLS_class::ACF_CARD_PAYMENT_STATE; // // $acf_id = 'user_' . $user_id; // // /* // * if prof is inactive, do nothing more // * // */ // $is_activ = get_field($acf_prof_is_activ['_name'], $acf_id); // if (is_null($is_activ)) // return; // if (empty($is_activ)) // return; // if ($is_activ === $acf_prof_is_activ['activ']) // return; // // $cipf_prof_payement = new PLGNTLS_class(); // // $payement_status = get_field($acf_payment_status['_name'], $acf_id); // if ($payement_status === $acf_payment_status['success']) { // $cipf_prof_payement->add_to_front(array( // array( 'css' => '.cipf_prof_paiement_message#cipf_prof_paiement_reussi {display: block;}' ) // )); // } // else if ($payement_status === $acf_payment_status['failure']) { // $cipf_prof_payement->add_to_front(array( // array( 'css' => '.cipf_prof_paiement_message#cipf_prof_paiement_echoue {display: block;}' ) // )); // } // // update_field($acf_payment_status['_name'], $acf_payment_status['nothing'], $acf_id); //} /* * early checks on profil page * */ function prof_profil_check_CIPF() { PLGNTLS_class::debug_infos(); // is an author page if (!is_author()) return; // the way to find the id of the author of an author_page $author_id = get_queried_object_id(); /* * in case event didn't fire, change account to expire here * */ if (card_date_exists_CIPF()) { if (is_card_date_expired_CIPF()) { if (!is_account_expired_CIPF()) { set_account_expired_CIPF(); } } } } add_action('wp', 'prof_profil_check_CIPF', 11); /* * if profil needs redirection, it happens here * */ function prof_profil_redirects_CIPF() { PLGNTLS_class::debug_infos(); // is an author page if (!is_author()) return; // the way to find the id of the author of an author_page $author_id = get_queried_object_id(); // redirections here } add_action('template_redirect', 'prof_profil_redirects_CIPF', 11); /* * time to upload some scripts and styles on prof profil page * */ function prof_profil_scripts_CIPF() { PLGNTLS_class::debug_infos(); // is an author page if (!is_author()) return; // the way to find the id of the author of an author_page $author_id = get_queried_object_id(); $cipf_prof = new PLGNTLS_class(); $cipf_prof->add_to_front(); } add_action('wp_enqueue_scripts', 'prof_profil_scripts_CIPF', 11); ?>