From a428402efaa4214a70fc882836e3689f1d18a3e3 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 20 Jan 2025 10:29:10 +0100 Subject: [PATCH] Move the hooks to init --- src/Gateway/MolliePaymentGateway.php | 2 +- src/PaymentMethods/AbstractPaymentMethod.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Gateway/MolliePaymentGateway.php b/src/Gateway/MolliePaymentGateway.php index 4ecd1386..11e6b2f3 100644 --- a/src/Gateway/MolliePaymentGateway.php +++ b/src/Gateway/MolliePaymentGateway.php @@ -128,7 +128,7 @@ public function __construct( $this->supports = $this->paymentMethod->getProperty('supports'); // Load the settings when translations are ready - add_action('after_setup_theme', [$this, 'init_form_fields']); + add_action('init', [$this, 'init_form_fields']); $this->init_settings(); $this->title = $this->paymentMethod->title(); diff --git a/src/PaymentMethods/AbstractPaymentMethod.php b/src/PaymentMethods/AbstractPaymentMethod.php index d5a11d38..1976e785 100644 --- a/src/PaymentMethods/AbstractPaymentMethod.php +++ b/src/PaymentMethods/AbstractPaymentMethod.php @@ -65,8 +65,8 @@ public function __construct( $this->config = $this->getConfig(); $this->settings = $this->getSettings(); $this->apiPaymentMethod = $apiPaymentMethod; - add_action('after_setup_theme', [$this, 'initializeTranslations']); - add_action('after_setup_theme', [$this, 'updateSettingsWithDefaults']); + add_action('init', [$this, 'initializeTranslations']); + add_action('init', [$this, 'updateSettingsWithDefaults']); } public function title(): string