Changeset 57831
- Timestamp:
- 03/14/2024 09:04:00 AM (11 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-textdomain-registry.php
r57639 r57831 184 184 } 185 185 186 $cache_key = 'cached_mo_files_' .md5( $path );187 $files = wp_cache_get( $cache_key, 'translation s' );186 $cache_key = md5( $path ); 187 $files = wp_cache_get( $cache_key, 'translation_files' ); 188 188 189 189 if ( false === $files ) { … … 198 198 } 199 199 200 wp_cache_set( $cache_key, $files, 'translation s');200 wp_cache_set( $cache_key, $files, 'translation_files', HOUR_IN_SECONDS ); 201 201 } 202 202 … … 247 247 switch ( $type ) { 248 248 case 'plugin': 249 wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins/' ), 'translations' );249 wp_cache_delete( md5( WP_LANG_DIR . '/plugins/' ), 'translation_files' ); 250 250 break; 251 251 case 'theme': 252 wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/themes/' ), 'translations' );252 wp_cache_delete( md5( WP_LANG_DIR . '/themes/' ), 'translation_files' ); 253 253 break; 254 254 default: 255 wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/' ), 'translations' );255 wp_cache_delete( md5( WP_LANG_DIR . '/' ), 'translation_files' ); 256 256 break; 257 257 } -
trunk/src/wp-includes/load.php
r57773 r57831 877 877 'site-transient', 878 878 'theme_files', 879 'translation_files', 879 880 'rss', 880 881 'users', -
trunk/tests/phpunit/tests/l10n/wpTextdomainRegistry.php
r57516 r57831 20 20 21 21 public function tear_down() { 22 wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/foobar/' ), 'translations' );23 wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins/' ), 'translations' );24 wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/themes/' ), 'translations' );25 wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/' ), 'translations' );22 wp_cache_delete( md5( WP_LANG_DIR . '/foobar/' ), 'translation_files' ); 23 wp_cache_delete( md5( WP_LANG_DIR . '/plugins/' ), 'translation_files' ); 24 wp_cache_delete( md5( WP_LANG_DIR . '/themes/' ), 'translation_files' ); 25 wp_cache_delete( md5( WP_LANG_DIR . '/' ), 'translation_files' ); 26 26 27 27 parent::tear_down(); … … 50 50 ); 51 51 $this->assertNotFalse( 52 wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/bar/' ), 'translations' ),52 wp_cache_get( md5( WP_LANG_DIR . '/bar/' ), 'translation_files' ), 53 53 'List of files in custom path not cached' 54 54 ); … … 90 90 $this->instance->get_language_files_from_path( WP_LANG_DIR . '/' ); 91 91 92 $this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins/' ), 'translations' ) );93 $this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/themes/' ), 'translations' ) );94 $this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/foobar/' ), 'translations' ) );95 $this->assertNotFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/' ), 'translations' ) );92 $this->assertNotFalse( wp_cache_get( md5( WP_LANG_DIR . '/plugins/' ), 'translation_files' ) ); 93 $this->assertNotFalse( wp_cache_get( md5( WP_LANG_DIR . '/themes/' ), 'translation_files' ) ); 94 $this->assertNotFalse( wp_cache_get( md5( WP_LANG_DIR . '/foobar/' ), 'translation_files' ) ); 95 $this->assertNotFalse( wp_cache_get( md5( WP_LANG_DIR . '/' ), 'translation_files' ) ); 96 96 } 97 97 … … 104 104 remove_filter( 'pre_get_language_files_from_path', '__return_empty_array' ); 105 105 106 $cache = wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins/' ), 'translations' );106 $cache = wp_cache_get( md5( WP_LANG_DIR . '/plugins/' ), 'translation_files' ); 107 107 108 108 $this->assertEmpty( $result ); … … 145 145 ); 146 146 147 $this->assertFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins/' ), 'translations' ) );148 $this->assertFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/themes/' ), 'translations' ) );149 $this->assertFalse( wp_cache_get( 'cached_mo_files_' . md5( WP_LANG_DIR . '/' ), 'translations' ) );147 $this->assertFalse( wp_cache_get( md5( WP_LANG_DIR . '/plugins/' ), 'translation_files' ) ); 148 $this->assertFalse( wp_cache_get( md5( WP_LANG_DIR . '/themes/' ), 'translation_files' ) ); 149 $this->assertFalse( wp_cache_get( md5( WP_LANG_DIR . '/' ), 'translation_files' ) ); 150 150 } 151 151
Note: See TracChangeset
for help on using the changeset viewer.