diff --git src/wp-includes/l10n.php src/wp-includes/l10n.php
index 7dd86607ec..3b07d66758 100644
|
|
function load_script_textdomain( $handle, $domain, $path = null ) { |
921 | 921 | // If a path was given and the handle file exists simply return it. |
922 | 922 | $file_base = $domain === 'default' ? $locale : $domain . '-' . $locale; |
923 | 923 | $handle_filename = $file_base . '-' . $handle . '.json'; |
924 | | if ( $path && file_exists( $path . '/' . $handle_filename ) ) { |
925 | | return load_script_translations( $path . '/' . $handle_filename, $handle, $domain ); |
| 924 | $translations = load_script_translations( $path . '/' . $handle_filename, $handle, $domain ); |
| 925 | |
| 926 | if ( $translations ) { |
| 927 | return $translations; |
926 | 928 | } |
927 | 929 | |
928 | 930 | $src = $wp_scripts->registered[ $handle ]->src; |
… |
… |
function load_script_textdomain( $handle, $domain, $path = null ) { |
982 | 984 | } |
983 | 985 | |
984 | 986 | $md5_filename = $file_base . '-' . md5( $relative ) . '.json'; |
985 | | if ( $path && file_exists( $path . '/' . $md5_filename ) ) { |
986 | | return load_script_translations( $path . '/' . $md5_filename, $handle, $domain ); |
| 987 | |
| 988 | $translations = load_script_translations( $path . '/' . $md5_filename, $handle, $domain ); |
| 989 | |
| 990 | if ( $translations ) { |
| 991 | return $translations; |
987 | 992 | } |
988 | | if ( file_exists( $languages_path . '/' . $md5_filename ) ) { |
989 | | return load_script_translations( $languages_path . '/' . $md5_filename, $handle, $domain ); |
| 993 | |
| 994 | $translations = load_script_translations( $languages_path . '/' . $md5_filename, $handle, $domain ); |
| 995 | |
| 996 | if ( $translations ) { |
| 997 | return $translations; |
990 | 998 | } |
991 | 999 | |
992 | 1000 | return load_script_translations( false, $handle, $domain ); |