updated plgntls :

- renamed PLGNTLS_class -> Plgntls
- changed method 'add_to_front()' to static method
- moved fetch script as inline script, so the plgntls file is single
- improved the way inline script and styles are added
This commit is contained in:
asus
2024-03-29 21:56:12 +01:00
parent 42e8cbc4e9
commit ade0be87ce
41 changed files with 457 additions and 421 deletions

View File

@@ -17,14 +17,14 @@ if (!defined('ABSPATH')) {
*
*/
function payment_page_checks_CIPF() {
PLGNTLS_class::debug_infos(2);
$slug_paypal_page = PLGNTLS_class::SLUG_PAYPAL_PAGE;
Plgntls::debug_infos(2);
$slug_paypal_page = Plgntls::SLUG_PAYPAL_PAGE;
// check the slug
if (!is_page($slug_paypal_page)) {
return;
}
PLGNTLS_class::debug_infos();
Plgntls::debug_infos();
// get the user id
$user_id = get_current_user_id();
@@ -42,9 +42,9 @@ add_action('wp', 'payment_page_checks_CIPF');
*
*/
function payment_page_redirects_CIPF() {
PLGNTLS_class::debug_infos(2);
$slug_paypal_page = PLGNTLS_class::SLUG_PAYPAL_PAGE;
$role_prof = PLGNTLS_class::ROLE_PROF;
Plgntls::debug_infos(2);
$slug_paypal_page = Plgntls::SLUG_PAYPAL_PAGE;
$role_prof = Plgntls::ROLE_PROF;
// don't redirect if it is the divi builder mode
if (et_fb_is_enabled()) {
@@ -54,7 +54,7 @@ function payment_page_redirects_CIPF() {
if (!is_page($slug_paypal_page)) {
return;
}
PLGNTLS_class::debug_infos();
Plgntls::debug_infos();
/*
* if prof, don't redirect
@@ -77,14 +77,14 @@ add_action('template_redirect', 'payment_page_redirects_CIPF');
*
*/
function payment_page_scripts_CIPF() {
PLGNTLS_class::debug_infos(2);
$slug_paypal_page = PLGNTLS_class::SLUG_PAYPAL_PAGE;
Plgntls::debug_infos(2);
$slug_paypal_page = Plgntls::SLUG_PAYPAL_PAGE;
// check the slug
if (!is_page($slug_paypal_page)) {
return;
}
PLGNTLS_class::debug_infos();
Plgntls::debug_infos();
// get the user id
$user_id = get_current_user_id();