-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/translation error in blocks #986
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there must be other ways to do it
src/Gateway/MolliePaymentGateway.php
Outdated
// Load the settings. | ||
$this->init_form_fields(); | ||
// Load the settings when translations are ready | ||
add_action('after_setup_theme', [$this, 'init_form_fields']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not on init ?
@@ -61,6 +65,8 @@ public function __construct( | |||
$this->config = $this->getConfig(); | |||
$this->settings = $this->getSettings(); | |||
$this->apiPaymentMethod = $apiPaymentMethod; | |||
add_action('after_setup_theme', [$this, 'initializeTranslations']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better is to use init
This PR solves an issue where the Mollie methods in blocks appeared as non compatible. This was due to the change in the init hook. Now we are back to the
plugins_loaded
hook. To avoid the translations called too early issue the payment fields were moved to a later hookafter_setup_theme