Ticket #38788: 38788.diff
File 38788.diff, 1.1 KB (added by , 9 years ago) |
---|
-
wp-includes/l10n.php
947 947 * The default directory is WP_LANG_DIR. 948 948 * 949 949 * @since 3.0.0 950 * @since 4.7.0 The results are now filtrable. 950 951 * 951 952 * @param string $dir A directory to search for language files. 952 953 * Default WP_LANG_DIR. … … 955 956 function get_available_languages( $dir = null ) { 956 957 $languages = array(); 957 958 958 $lang_files = glob( ( is_null( $dir ) ? WP_LANG_DIR : $dir ) . '/*.mo' );959 $lang_files = glob( ( is_null( $dir ) ? WP_LANG_DIR : $dir ) . '/*.mo' ); 959 960 if ( $lang_files ) { 960 961 foreach ( $lang_files as $lang_file ) { 961 962 $lang_file = basename( $lang_file, '.mo' ); … … 966 967 } 967 968 } 968 969 969 return $languages; 970 /** 971 * Filters the list of available language codes 972 * 973 * @since 4.7.0 974 * 975 * @param array $languages An array of language codes or an empty array. 976 * @param string $dir A directory to search for language files. 977 */ 978 return apply_filters( 'get_available_languages', $languages, $dir ); 970 979 } 971 980 972 981 /**