Changeset 43898
- Timestamp:
- 11/15/2018 02:36:39 PM (6 years ago)
- Location:
- branches/5.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-includes/class.wp-scripts.php
r43878 r43898 529 529 530 530 if ( ! $json_translations ) { 531 return false; 531 // Register empty locale data object to ensure the domain still exists. 532 $json_translations = '{ "locale_data": { "messages": { "": {} } } }'; 532 533 } 533 534 -
branches/5.0/src/wp-includes/l10n.php
r43859 r43898 924 924 $relative = array_slice( $relative, 2 ); 925 925 $relative = implode( '/', $relative ); 926 } else if ( 927 ! isset( $site_url['path'] ) && 928 ( ! isset( $src_url['host'] ) || $src_url['host'] !== $site_url['host'] ) 929 ) { 930 $relative = trim( $src_url['path'], '/' ); 931 } else if ( 932 ( strpos( $src_url['path'], $site_url['path'] ) === 0 ) && 933 ( ! isset( $src_url['host'] ) || $src_url['host'] !== $site_url['host'] ) 934 ) { 935 // Make the src relative to the WP root. 936 $relative = substr( $src, strlen( $site_url['path'] ) ); 937 $relative = trim( $relative, '/' ); 926 } elseif ( ! isset( $src_url['host'] ) || $src_url['host'] !== $site_url['host'] ) { 927 if ( ! isset( $site_url['path'] ) ) { 928 $relative = trim( $src_url['path'], '/' ); 929 } elseif ( ( strpos( $src_url['path'], $site_url['path'] ) === 0 ) ) { 930 // Make the src relative to the WP root. 931 $relative = substr( $src, strlen( $site_url['path'] ) ); 932 $relative = trim( $relative, '/' ); 933 } 938 934 } 939 935 -
branches/5.0/tests/phpunit/tests/dependencies/scripts.php
r43878 r43898 864 864 865 865 $expected = "<script type='text/javascript' src='/wp-includes/js/dist/wp-i18n.js'></script>"; 866 $expected .= "\n<script type='text/javascript' src='/wp-admin/js/script.js'></script>\n"; 866 $expected .= "\n<script type='text/javascript'>\n(function( translations ){" . 867 "translations.locale_data.messages[\"\"].domain = \"admin\";" . 868 "wp.i18n.setLocaleData( translations.locale_data.messages, \"admin\" );" . 869 "})({ \"locale_data\": { \"messages\": { \"\": {} } } });\n</script>\n"; 870 $expected .= "<script type='text/javascript' src='/wp-admin/js/script.js'></script>\n"; 867 871 868 872 $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
Note: See TracChangeset
for help on using the changeset viewer.