Skip to content

Commit

Permalink
Move the hooks to init
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Jan 20, 2025
1 parent c4ef709 commit a428402
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Gateway/MolliePaymentGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/PaymentMethods/AbstractPaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a428402

Please sign in to comment.