Skip to content
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 _load_textdomain_just_in_time notice in WordPress 6.7 #365

Merged
merged 9 commits into from
Nov 18, 2024
12 changes: 10 additions & 2 deletions admin/class-nginx-helper-admin.php
Original file line number Diff line number Diff line change
@@ -78,6 +78,15 @@ public function __construct( $plugin_name, $version ) {
$this->plugin_name = $plugin_name;
$this->version = $version;

$this->options = $this->nginx_helper_settings();
}

/**
* Initialize the settings tab.
* Required since i18n is used in the settings tab which can be invoked only after init hook since WordPress 6.7
*/
public function initialize_setting_tab() {

/**
* Define settings tabs
*/
@@ -94,10 +103,9 @@ public function __construct( $plugin_name, $version ) {
),
)
);

$this->options = $this->nginx_helper_settings();
}


Copy link
Member

@Pathan-Amaankhan Pathan-Amaankhan Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small thing, Please remove the additional line before merging the PR.

/**
* Register the stylesheets for the admin area.
*
2 changes: 1 addition & 1 deletion includes/class-nginx-helper.php
Original file line number Diff line number Diff line change
@@ -169,7 +169,7 @@ private function define_admin_hooks() {
global $nginx_helper_admin, $nginx_purger;

$nginx_helper_admin = new Nginx_Helper_Admin( $this->get_plugin_name(), $this->get_version() );

$this->loader->add_action( 'init', $nginx_helper_admin, 'initialize_setting_tab' );
// Defines global variables.
if ( ! empty( $nginx_helper_admin->options['cache_method'] ) && 'enable_redis' === $nginx_helper_admin->options['cache_method'] ) {