From 95a76647c9243aac43a1e7e22fa4056639e337b2 Mon Sep 17 00:00:00 2001 From: "admin@knitpay.org" Date: Tue, 4 Jun 2024 13:26:53 +0530 Subject: [PATCH 1/2] Execute handle_returns and maybe_redirect at the end. Fixing Notification issue. --- src/Plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Plugin.php b/src/Plugin.php index 2cc50faa..e2eb7025 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -269,8 +269,8 @@ public function __construct( $args = [] ) { add_action( 'init', [ $this, 'register_styles' ], 9 ); // If WordPress is loaded check on returns and maybe redirect requests. - add_action( 'wp_loaded', [ $this, 'handle_returns' ], 10 ); - add_action( 'wp_loaded', [ $this, 'maybe_redirect' ], 10 ); + add_action( 'wp_loaded', [ $this, 'handle_returns' ], PHP_INT_MAX ); + add_action( 'wp_loaded', [ $this, 'maybe_redirect' ], PHP_INT_MAX ); // Default date time format. add_filter( 'pronamic_datetime_default_format', [ $this, 'datetime_format' ], 10, 1 ); From 4819307ce7a05dbd2107ec10d92f865c8ad5ee4b Mon Sep 17 00:00:00 2001 From: Gautam Garg <65900807+knit-pay@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:41:20 +0530 Subject: [PATCH 2/2] Updated Priority to 100 Updated priority to 100 as suggested by @remcotolsma --- src/Plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Plugin.php b/src/Plugin.php index e2eb7025..5cfec8ba 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -269,8 +269,8 @@ public function __construct( $args = [] ) { add_action( 'init', [ $this, 'register_styles' ], 9 ); // If WordPress is loaded check on returns and maybe redirect requests. - add_action( 'wp_loaded', [ $this, 'handle_returns' ], PHP_INT_MAX ); - add_action( 'wp_loaded', [ $this, 'maybe_redirect' ], PHP_INT_MAX ); + add_action( 'wp_loaded', [ $this, 'handle_returns' ], 100 ); + add_action( 'wp_loaded', [ $this, 'maybe_redirect' ], 100 ); // Default date time format. add_filter( 'pronamic_datetime_default_format', [ $this, 'datetime_format' ], 10, 1 );