Changeset 43859 for branches/5.0/src/wp-includes/l10n.php
- Timestamp:
- 11/01/2018 01:50:59 PM (7 years ago)
- File:
-
- 1 edited
-
branches/5.0/src/wp-includes/l10n.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-includes/l10n.php
r43846 r43859 877 877 * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. 878 878 * 879 * @since 5.0.0 880 * 879 881 * @param string $handle Name of the script to register a translation domain to. 880 882 * @param string $domain The textdomain. … … 887 889 global $wp_scripts; 888 890 891 $path = untrailingslashit( $path ); 889 892 $locale = is_admin() ? get_locale() : get_user_locale(); 890 893 891 894 // If a path was given and the handle file exists simply return it. 892 $handle_filename = $domain . '-' . $locale . '-' . $handle . '.json'; 895 $file_base = $domain === 'default' ? $locale : $domain . '-' . $locale; 896 $handle_filename = $file_base . '-' . $handle . '.json'; 893 897 if ( $path && file_exists( $path . '/' . $handle_filename ) ) { 894 898 return file_get_contents( $path . '/' . $handle_filename ); … … 909 913 // If the host is the same or it's a relative URL. 910 914 if ( 911 strpos( $ content_url['path'], $src_url['path'] ) === 0 &&915 strpos( $src_url['path'], $content_url['path'] ) === 0 && 912 916 ( ! isset( $src_url['host'] ) || $src_url['host'] !== $content_url['host'] ) 913 917 ) { … … 926 930 $relative = trim( $src_url['path'], '/' ); 927 931 } else if ( 928 ( strpos( $s ite_url['path'], $src_url['path'] ) === 0 ) &&932 ( strpos( $src_url['path'], $site_url['path'] ) === 0 ) && 929 933 ( ! isset( $src_url['host'] ) || $src_url['host'] !== $site_url['host'] ) 930 934 ) { … … 944 948 } 945 949 946 $md5_filename = $ domain . '-' . $locale . '-' . md5( $relative ) . '.json';950 $md5_filename = $file_base . '-' . md5( $relative ) . '.json'; 947 951 if ( $path && file_exists( $path . '/' . $md5_filename ) ) { 948 952 return file_get_contents( $path . '/' . $md5_filename );
Note: See TracChangeset
for help on using the changeset viewer.