updated acf find non init field value with new technique to init with temp value first

This commit is contained in:
asus
2024-03-19 20:15:26 +01:00
parent cbfbfabd18
commit 58d02708b9
8 changed files with 154 additions and 36 deletions

View File

@@ -0,0 +1,94 @@
<?php
/*
* it means someone outside wp is accessing the file, in this case kill it.
*/
if (!defined('ABSPATH')) {
die('You can not access this file!');
}
/*
* early checks on payment page
*
*/
function payment_page_checks_CIPF() {
PLGNTLS_class::debug_infos();
$slug_paypal_page = PLGNTLS_class::SLUG_PAYPAL_PAGE;
// check the slug
global $wp;
$current_slug = $wp->request;
if ($current_slug !== $slug_paypal_page) {
return;
}
// get the user id
$user_id = get_current_user_id();
// do checks here
}
add_action('wp', 'payment_page_checks_CIPF');
/*
* if profil needs redirection, it happens here
*
*/
function payment_page_redirects_CIPF() {
PLGNTLS_class::debug_infos();
$slug_paypal_page = PLGNTLS_class::SLUG_PAYPAL_PAGE;
// check the slug
global $wp;
$current_slug = $wp->request;
if ($current_slug !== $slug_paypal_page) {
return;
}
// get the user id
$user_id = get_current_user_id();
// do redirections here
}
add_action('template_redirect', 'payment_page_redirects_CIPF');
/*
* time to upload some scripts and styles on prof profil page
*
*/
function payment_page_scripts_CIPF() {
PLGNTLS_class::debug_infos();
$slug_paypal_page = PLGNTLS_class::SLUG_PAYPAL_PAGE;
// check the slug
global $wp;
$current_slug = $wp->request;
if ($current_slug !== $slug_paypal_page) {
return;
}
// get the user id
$user_id = get_current_user_id();
// enqueue files here
display_page_css_CIPF($user_id);
}
add_action('wp_enqueue_scripts', 'payment_page_scripts_CIPF');
?>

View File

@@ -17,6 +17,7 @@ include_once(PLGNTLS_class::root_path() . '/php/paypal/shortcode.php');
include_once(PLGNTLS_class::root_path() . '/php/paypal/route_api_orders.php');
include_once(PLGNTLS_class::root_path() . '/php/paypal/route_api_orders_capture.php');
include_once(PLGNTLS_class::root_path() . '/php/paypal/routes.php');
include_once(PLGNTLS_class::root_path() . '/php/paypal/payment_page.php');