From 24ca84552d243bb23b8d01b909e5ce1cf639091b Mon Sep 17 00:00:00 2001 From: J O S H M O T O Date: Tue, 10 Dec 2024 11:11:27 +0000 Subject: [PATCH] Fix: Adjust text domain loading for WordPress 6.7.0+ compatibility - Moved `load_plugin_textdomain` call to the 'init' action in the constructor. - Resolves deprecation notice for early translation loading in WordPress 6.7.0+. - Ensures compatibility with updated WordPress translation loading requirements. Tested and verified to remove the notice in a local environment. --- acf-image-aspect-ratio-crop.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/acf-image-aspect-ratio-crop.php b/acf-image-aspect-ratio-crop.php index 4486492..1dae6fd 100644 --- a/acf-image-aspect-ratio-crop.php +++ b/acf-image-aspect-ratio-crop.php @@ -60,7 +60,9 @@ function __construct() // set text domain // https://codex.wordpress.org/Function_Reference/load_plugin_textdomain - load_plugin_textdomain('acf-image-aspect-ratio-crop'); + add_action('init', function () { + load_plugin_textdomain('acf-image-aspect-ratio-crop'); + }); add_action('plugins_loaded', [$this, 'initialize_settings']);