Created
November 19, 2024 17:38
-
-
Save dieppon/66a49d2f7024a0f7d192ed0b00e2c808 to your computer and use it in GitHub Desktop.
update-to-wp6-7-_load_textdomain_just_in_time-was-called-incorrectly/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/classes/class-uagb-loader.php b/classes/class-uagb-loader.php | |
index 31a5464..8968479 100644 | |
--- a/classes/class-uagb-loader.php | |
+++ b/classes/class-uagb-loader.php | |
@@ -373,7 +373,9 @@ if ( ! class_exists( 'UAGB_Loader' ) ) { | |
*/ | |
$lang_dir = apply_filters( 'uagb_languages_directory', UAGB_ROOT . '/languages/' ); | |
- load_plugin_textdomain( 'ultimate-addons-for-gutenberg', false, $lang_dir ); | |
+ add_action( 'init', function () { | |
+ load_plugin_textdomain( 'ultimate-addons-for-gutenberg', false, $lang_dir ); | |
+ } ); | |
} | |
/** | |
diff --git a/lib/gutenberg-templates/ast-block-plugin-loader.php b/lib/gutenberg-templates/ast-block-plugin-loader.php | |
index f89cd2b..07cde73 100644 | |
--- a/lib/gutenberg-templates/ast-block-plugin-loader.php | |
+++ b/lib/gutenberg-templates/ast-block-plugin-loader.php | |
@@ -174,7 +174,9 @@ class Ast_Block_Plugin_Loader { | |
load_textdomain( 'ast-block-templates', $mofile_local ); | |
} else { | |
// Load the default language files. | |
- load_plugin_textdomain( 'ast-block-templates', false, $lang_dir ); | |
+ add_action( 'init', function () { | |
+ load_plugin_textdomain( 'ast-block-templates', false, $lang_dir ); | |
+ } ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment