Make WordPress Core


Ignore:
Timestamp:
01/15/2024 07:03:27 PM (13 months ago)
Author:
swissspidy
Message:

I18N: Cache list of language file paths in WP_Textdomain_Registry.

Loading a list of language file paths using glob() can be expensive if involving thousands of files.

Expands scope of WP_Textdomain_Registry to cache list of language file paths in object cache and provides a way to invalidate that cache upon translation updates. Plugins can clear the cache using calls such as wp_cache_delete( 'cached_mo_files_' . md5( $path ), 'translations' );

Props mreishus, swissspidy
Fixes #58919

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-settings.php

    r57269 r57287  
    381381 */
    382382$GLOBALS['wp_textdomain_registry'] = new WP_Textdomain_Registry();
     383$GLOBALS['wp_textdomain_registry']->init();
    383384
    384385// Load multisite-specific files.
Note: See TracChangeset for help on using the changeset viewer.