Changeset 57639
- Timestamp:
- 02/16/2024 10:26:14 AM (10 months ago)
- Location:
- trunk
- Files:
-
- 9 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-textdomain-registry.php
r57516 r57639 315 315 if ( $file_path === $mo_path || $file_path === $php_path ) { 316 316 $found_location = rtrim( $location, '/' ) . '/'; 317 break 2; 317 318 } 318 319 } -
trunk/src/wp-includes/l10n.php
r57516 r57639 1436 1436 1437 1437 /** 1438 * Gets all available languages based on the presence of *.mo files in a given directory.1438 * Gets all available languages based on the presence of *.mo and *.l10n.php files in a given directory. 1439 1439 * 1440 1440 * The default directory is WP_LANG_DIR. … … 1442 1442 * @since 3.0.0 1443 1443 * @since 4.7.0 The results are now filterable with the {@see 'get_available_languages'} filter. 1444 * @since 6.5.0 The initial file list is now cached and also takes into account *.l10n.php files. 1444 1445 * 1445 1446 * @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry. … … 1448 1449 * Default WP_LANG_DIR. 1449 1450 * @return string[] An array of language codes or an empty array if no languages are present. 1450 * Language codes are formed by stripping the .moextension from the language file names.1451 * Language codes are formed by stripping the file extension from the language file names. 1451 1452 */ 1452 1453 function get_available_languages( $dir = null ) { … … 1461 1462 foreach ( $lang_files as $lang_file ) { 1462 1463 $lang_file = basename( $lang_file, '.mo' ); 1464 $lang_file = basename( $lang_file, '.l10n.php' ); 1465 1463 1466 if ( ! str_starts_with( $lang_file, 'continents-cities' ) && ! str_starts_with( $lang_file, 'ms-' ) && 1464 1467 ! str_starts_with( $lang_file, 'admin-' ) ) { … … 1476 1479 * @param string $dir The directory where the language files were found. 1477 1480 */ 1478 return apply_filters( 'get_available_languages', $languages, $dir );1481 return apply_filters( 'get_available_languages', array_unique( $languages ), $dir ); 1479 1482 } 1480 1483
Note: See TracChangeset
for help on using the changeset viewer.