From 316b404131fa0e1efeb40c518d5e6417afe482d3 Mon Sep 17 00:00:00 2001 From: joshuapregua Date: Thu, 27 Nov 2025 23:50:34 +0800 Subject: [PATCH] fix: resolved deprecated notice for early trigger --- includes/class-genesis-simple-sidebars-admin.php | 14 ++++++++++++-- includes/class-genesis-simple-sidebars.php | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/includes/class-genesis-simple-sidebars-admin.php b/includes/class-genesis-simple-sidebars-admin.php index 8f6f236..2625a48 100644 --- a/includes/class-genesis-simple-sidebars-admin.php +++ b/includes/class-genesis-simple-sidebars-admin.php @@ -51,8 +51,18 @@ class Genesis_Simple_Sidebars_Admin extends Genesis_Admin_Basic { $menu_ops = array( 'submenu' => array( 'parent_slug' => 'genesis', - 'page_title' => __( 'Genesis - Simple Sidebars', 'genesis-simple-sidebars' ), - 'menu_title' => __( 'Simple Sidebars', 'genesis-simple-sidebars' ), + + /* + * These strings intentionally avoid using the plugin text + * domain here because this method can be called before the + * `init` action (via `genesis_setup`). Using `__()` with the + * `genesis-simple-sidebars` domain at that point would cause + * WordPress 6.7+ to emit a "_load_textdomain_just_in_time + * was called incorrectly" notice. Other plugin strings remain + * fully translatable once the text domain is loaded on `init`. + */ + 'page_title' => 'Genesis - Simple Sidebars', + 'menu_title' => 'Simple Sidebars', ), ); diff --git a/includes/class-genesis-simple-sidebars.php b/includes/class-genesis-simple-sidebars.php index e960246..20ada48 100644 --- a/includes/class-genesis-simple-sidebars.php +++ b/includes/class-genesis-simple-sidebars.php @@ -86,7 +86,7 @@ class Genesis_Simple_Sidebars { */ public function init() { - $this->load_plugin_textdomain(); + add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); add_action( 'admin_notices', array( $this, 'requirements_notice' ) );