This commit is contained in:
2026-10-06 19:11:48 -06:00
parent 5c09d6fa68
commit 2952d163f5
233 changed files with 28318 additions and 11 deletions
+23 -1
View File
@@ -144,8 +144,30 @@ function rocket_load_textdomain() {
load_textdomain( 'rocket', WP_LANG_DIR . '/plugins/wp-rocket-' . $locale . '.mo' );
load_plugin_textdomain( 'rocket', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
// WP 6.7 warns if the rocket domain is translated before after_setup_theme.
// Hold an empty catalog until then so boot-time strings do not trigger JIT loading.
if ( ! is_textdomain_loaded( 'rocket' ) ) {
global $l10n;
$l10n['rocket'] = new NOOP_Translations();
}
}
add_action( 'plugins_loaded', 'rocket_load_textdomain' );
/**
* Drops the temporary catalog so later requests can load the real translations.
*
* @return void
*/
function rocket_release_early_textdomain() {
global $l10n;
if ( isset( $l10n['rocket'] ) && $l10n['rocket'] instanceof NOOP_Translations ) {
unset( $l10n['rocket'] );
}
}
add_action( 'plugins_loaded', 'rocket_load_textdomain', 1 );
add_action( 'after_setup_theme', 'rocket_release_early_textdomain', 0 );
$wp_rocket_requirement_checks = new WP_Rocket_Requirements_Check(
[