Changeset 47122 for trunk/src/wp-includes/script-loader.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/script-loader.php (modified) (26 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/script-loader.php
r47106 r47122 52 52 && false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && ! $force_uncompressed; 53 53 54 // Load tinymce.js when running from /src, otherwise load wp-tinymce.js.gz (in production) or55 // tinymce.min.js (when SCRIPT_DEBUG is true).54 // Load tinymce.js when running from /src, otherwise load wp-tinymce.js.gz (in production) 55 // or tinymce.min.js (when SCRIPT_DEBUG is true). 56 56 if ( $compressed ) { 57 57 $scripts->add( 'wp-tinymce', includes_url( 'js/tinymce/' ) . 'wp-tinymce.js', array(), $tinymce_version ); … … 199 199 // Test presence of feature... 200 200 '( ' . $test . ' ) || ' . 201 // ...appending polyfill on any failures. Cautious viewers may balk 202 // at the `document.write`. Its caveat of synchronous mid-stream 203 // blocking write is exactly the behavior we need though. 201 /* 202 * ...appending polyfill on any failures. Cautious viewers may balk 203 * at the `document.write`. Its caveat of synchronous mid-stream 204 * blocking write is exactly the behavior we need though. 205 */ 204 206 'document.write( \'<script src="' . 205 207 $src . … … 594 596 595 597 if ( $suffixes === null ) { 596 include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version 598 // Include an unmodified $wp_version. 599 include( ABSPATH . WPINC . '/version.php' ); 597 600 598 601 $develop_src = false !== strpos( $wp_version, '-src' ); … … 796 799 $scripts->add( 'scriptaculous', false, array( 'scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls' ) ); 797 800 798 // not used in core, replaced by Jcrop.js801 // Not used in core, replaced by Jcrop.js. 799 802 $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array( 'scriptaculous-dragdrop' ) ); 800 803 801 // jQuery 804 // jQuery. 802 805 $scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.12.4-wp' ); 803 806 $scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.12.4-wp' ); 804 807 $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.4.1' ); 805 808 806 // full jQuery UI809 // Full jQuery UI. 807 810 $scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$dev_suffix.js", array( 'jquery' ), '1.11.4', 1 ); 808 811 $scripts->add( 'jquery-effects-core', "/wp-includes/js/jquery/ui/effect$dev_suffix.js", array( 'jquery' ), '1.11.4', 1 ); … … 845 848 $scripts->add( 'jquery-ui-widget', "/wp-includes/js/jquery/ui/widget$dev_suffix.js", array( 'jquery' ), '1.11.4', 1 ); 846 849 847 // Strings for 'jquery-ui-autocomplete' live region messages 850 // Strings for 'jquery-ui-autocomplete' live region messages. 848 851 did_action( 'init' ) && $scripts->localize( 849 852 'jquery-ui-autocomplete', … … 859 862 ); 860 863 861 // deprecated, not used in core, most functionality is included in jQuery 1.3864 // Deprecated, not used in core, most functionality is included in jQuery 1.3. 862 865 $scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array( 'jquery' ), '4.2.1', 1 ); 863 866 864 // jQuery plugins 867 // jQuery plugins. 865 868 $scripts->add( 'jquery-color', '/wp-includes/js/jquery/jquery.color.min.js', array( 'jquery' ), '2.1.2', 1 ); 866 869 $scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array( 'jquery' ), '20m', 1 ); … … 943 946 did_action( 'init' ) && $scripts->localize( 'wp-plupload', 'pluploadL10n', $uploader_l10n ); 944 947 945 // keep 'swfupload' for back-compat.948 // Keep 'swfupload' for back-compat. 946 949 $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', array(), '2201-20110113' ); 947 950 $scripts->add( 'swfupload-all', false, array( 'swfupload' ), '2201' ); … … 1106 1109 'singular' => _n( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.', 1 ), 1107 1110 /* translators: %d: Error count. */ 1108 'plural' => _n( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491. 1111 'plural' => _n( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.', 2 ), 1112 // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491. 1109 1113 ), 1110 1114 ) … … 1233 1237 'autosaveNotice' => __( 'There is a more recent autosave of your changes than the one you are previewing. <a href="%s">Restore the autosave</a>' ), 1234 1238 'videoHeaderNotice' => __( 'This theme doesn’t support video headers on this page. Navigate to the front page or another page that supports video headers.' ), 1235 // Used for overriding the file types allowed in plupload.1239 // Used for overriding the file types allowed in Plupload. 1236 1240 'allowedFiles' => __( 'Allowed Files' ), 1237 1241 'customCssError' => array( … … 1239 1243 'singular' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 1 ), 1240 1244 /* translators: %d: Error count. */ 1241 'plural' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491. 1245 'plural' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 2 ), 1246 // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491. 1242 1247 ), 1243 1248 'pageOnFrontError' => __( 'Homepage and posts page must be different.' ), … … 1246 1251 'singular' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 1 ), 1247 1252 /* translators: %s: Number of invalid settings. */ 1248 'plural' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491. 1253 'plural' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 2 ), 1254 // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491. 1249 1255 ), 1250 1256 'scheduleDescription' => __( 'Schedule your customization changes to publish ("go live") at a future date.' ), … … 1525 1531 'installFailed' => __( 'Installation failed: %s' ), 1526 1532 /* translators: %s: Plugin name and version. */ 1527 'pluginInstallingLabel' => _x( 'Installing %s...', 'plugin' ), // no ellipsis1533 'pluginInstallingLabel' => _x( 'Installing %s...', 'plugin' ), // No ellipsis. 1528 1534 /* translators: %s: Theme name and version. */ 1529 'themeInstallingLabel' => _x( 'Installing %s...', 'theme' ), // no ellipsis1535 'themeInstallingLabel' => _x( 'Installing %s...', 'theme' ), // No ellipsis. 1530 1536 /* translators: %s: Plugin name and version. */ 1531 1537 'pluginInstalledLabel' => _x( '%s installed!', 'plugin' ), … … 1617 1623 array( 1618 1624 'setThumbnail' => __( 'Use as featured image' ), 1619 'saving' => __( 'Saving...' ), // no ellipsis1625 'saving' => __( 'Saving...' ), // No ellipsis. 1620 1626 'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ), 1621 1627 'done' => __( 'Done' ), … … 1663 1669 */ 1664 1670 function wp_default_styles( &$styles ) { 1665 include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version 1671 // Include an unmodified $wp_version. 1672 include( ABSPATH . WPINC . '/version.php' ); 1666 1673 1667 1674 if ( ! defined( 'SCRIPT_DEBUG' ) ) { … … 1705 1712 } 1706 1713 1707 // Hotlink Open Sans, for now 1714 // Hotlink Open Sans, for now. 1708 1715 $open_sans_font_url = "https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets&display=fallback"; 1709 1716 } … … 1714 1721 $suffix = SCRIPT_DEBUG ? '' : '.min'; 1715 1722 1716 // Admin CSS 1723 // Admin CSS. 1717 1724 $styles->add( 'common', "/wp-admin/css/common$suffix.css" ); 1718 1725 $styles->add( 'forms', "/wp-admin/css/forms$suffix.css" ); … … 1744 1751 $styles->add_data( 'ie', 'conditional', 'lte IE 7' ); 1745 1752 1746 // Common dependencies 1753 // Common dependencies. 1747 1754 $styles->add( 'buttons', "/wp-includes/css/buttons$suffix.css" ); 1748 1755 $styles->add( 'dashicons', "/wp-includes/css/dashicons$suffix.css" ); 1749 1756 1750 // Includes CSS 1757 // Includes CSS. 1751 1758 $styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array( 'dashicons' ) ); 1752 1759 $styles->add( 'wp-auth-check', "/wp-includes/css/wp-auth-check$suffix.css", array( 'dashicons' ) ); … … 1758 1765 $styles->add_data( 'wp-embed-template-ie', 'conditional', 'lte IE 8' ); 1759 1766 1760 // External libraries and friends 1767 // External libraries and friends. 1761 1768 $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8' ); 1762 1769 $styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array( 'dashicons' ) ); … … 1766 1773 $styles->add( 'wp-codemirror', '/wp-includes/js/codemirror/codemirror.min.css', array(), '5.29.1-alpha-ee20357' ); 1767 1774 1768 // Deprecated CSS 1775 // Deprecated CSS. 1769 1776 $styles->add( 'deprecated-media', "/wp-admin/css/deprecated-media$suffix.css" ); 1770 1777 $styles->add( 'farbtastic', "/wp-admin/css/farbtastic$suffix.css", array(), '1.3u1' ); 1771 1778 $styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.min.css', array(), '0.9.12' ); 1772 1779 $styles->add( 'colors-fresh', false, array( 'wp-admin', 'buttons' ) ); // Old handle. 1773 $styles->add( 'open-sans', $open_sans_font_url ); // No longer used in core as of 4.6 1774 1775 // Packages styles 1780 $styles->add( 'open-sans', $open_sans_font_url ); // No longer used in core as of 4.6. 1781 1782 // Packages styles. 1776 1783 $fonts_url = ''; 1777 1784 … … 1833 1840 } 1834 1841 1835 // RTL CSS 1842 // RTL CSS. 1836 1843 $rtl_styles = array( 1837 // Admin CSS 1844 // Admin CSS. 1838 1845 'common', 1839 1846 'forms', … … 1859 1866 'login', 1860 1867 'site-health', 1861 // Includes CSS 1868 // Includes CSS. 1862 1869 'buttons', 1863 1870 'admin-bar', … … 1867 1874 'wp-pointer', 1868 1875 'wp-jquery-ui-dialog', 1869 // Package styles 1876 // Package styles. 1870 1877 'wp-block-library-theme', 1871 1878 'wp-edit-blocks', … … 1878 1885 'wp-list-reusable-blocks', 1879 1886 'wp-nux', 1880 // Deprecated CSS 1887 // Deprecated CSS. 1881 1888 'deprecated-media', 1882 1889 'farbtastic', … … 1992 1999 'm', // Month. 1993 2000 'Y', 1994 'y', // Year.2001 'y', // Year. 1995 2002 ), 1996 2003 array( … … 2251 2258 if ( ! empty( $wp_scripts->print_code ) ) { 2252 2259 echo "\n<script{$type_attr}>\n"; 2253 echo "/* <![CDATA[ */\n"; // not needed in HTML 52260 echo "/* <![CDATA[ */\n"; // Not needed in HTML 5. 2254 2261 echo $wp_scripts->print_code; 2255 2262 echo "/* ]]> */\n"; … … 2294 2301 2295 2302 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 2296 return array(); // no need to run if nothing is queued2303 return array(); // No need to run if nothing is queued. 2297 2304 } 2298 2305 return print_head_scripts();
Note: See TracChangeset
for help on using the changeset viewer.