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