get_cache_data( $mofile ); $mtime = filemtime( $mofile ); $mo = new \MO(); if ( ! $data || ! isset( $data['mtime'] ) || $mtime > $data['mtime'] ) { if ( ! $mo->import_from_file( $mofile ) ) { return false; } $data = [ 'mtime' => $mtime, 'file' => $mofile, 'entries' => $mo->entries, 'headers' => $mo->headers, ]; $cache_handler->update_cache_data( $mofile, $data, __NAMESPACE__ . '\Translation_Entry' ); } else { $mo->entries = $data['entries']; $mo->headers = $data['headers']; } // Merge the translations with the existing translations for the domain. if ( isset( $l10n[ $domain ] ) ) { $mo->merge_with( $l10n[ $domain ] ); } // Set the translations for the domain. $l10n[ $domain ] = &$mo; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited // Return true to indicate success. return true; } if ( version_compare( $GLOBALS['wp_version'], '6.3' ) >= 0 ) { \add_filter( 'pre_load_textdomain', __NAMESPACE__ . '\a_faster_load_textdomain', 1, 4 ); } else { \add_filter( 'override_load_textdomain', __NAMESPACE__ . '\a_faster_load_textdomain', 0, 3 ); }