- Timestamp:
- 09/16/2020 10:07:05 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/locales.php
r10237 r10272 82 82 return wp_list_pluck( $locales, 'english_name', 'wp_locale' ); 83 83 } 84 85 /** 86 * Get the name of a locale from the code. 87 * 88 * @param string $code The locale code to look up. E.g. en_US. 89 * @param string $name_type Optional. 'native' or 'english'. Default 'native'. 90 * 91 * @return mixed|string 92 */ 93 function get_locale_name_from_code( $code, $name_type = 'native' ) { 94 $function = __NAMESPACE__ . "\get_locales_with_{$name_type}_names"; 95 $locales = $function(); 96 97 return $locales[ $code ] ?? ''; 98 } 84 99 }
Note: See TracChangeset
for help on using the changeset viewer.