Skip to content

Commit ce90897

Browse files
authoredNov 20, 2024
Merge pull request #368 from rtCamp/fix/add-setting-tab-on-init-hook
Fix _load_textdomain_just_in_time notice in WordPress 6.7
2 parents 05ec1a7 + 687c116 commit ce90897

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed
 

‎admin/class-nginx-helper-admin.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ public function __construct( $plugin_name, $version ) {
7878
$this->plugin_name = $plugin_name;
7979
$this->version = $version;
8080

81+
$this->options = $this->nginx_helper_settings();
82+
}
83+
84+
/**
85+
* Initialize the settings tab.
86+
* Required since i18n is used in the settings tab which can be invoked only after init hook since WordPress 6.7
87+
*/
88+
public function initialize_setting_tab() {
89+
8190
/**
8291
* Define settings tabs
8392
*/
@@ -94,8 +103,6 @@ public function __construct( $plugin_name, $version ) {
94103
),
95104
)
96105
);
97-
98-
$this->options = $this->nginx_helper_settings();
99106
}
100107

101108
/**

‎includes/class-nginx-helper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private function define_admin_hooks() {
169169
global $nginx_helper_admin, $nginx_purger;
170170

171171
$nginx_helper_admin = new Nginx_Helper_Admin( $this->get_plugin_name(), $this->get_version() );
172-
172+
$this->loader->add_action( 'init', $nginx_helper_admin, 'initialize_setting_tab' );
173173
// Defines global variables.
174174
if ( ! empty( $nginx_helper_admin->options['cache_method'] ) && 'enable_redis' === $nginx_helper_admin->options['cache_method'] ) {
175175

0 commit comments

Comments
 (0)