Changeset 43571 for trunk/src/wp-includes/script-loader.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/script-loader.php
r43345 r43571 70 70 $scripts->add( 'utils', "/wp-includes/js/utils$suffix.js" ); 71 71 did_action( 'init' ) && $scripts->localize( 72 'utils', 'userSettings', array( 72 'utils', 73 'userSettings', 74 array( 73 75 'url' => (string) SITECOOKIEPATH, 74 76 'uid' => (string) get_current_user_id(), … … 80 82 $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array( 'jquery', 'hoverIntent', 'utils' ), false, 1 ); 81 83 did_action( 'init' ) && $scripts->localize( 82 'common', 'commonL10n', array( 84 'common', 85 'commonL10n', 86 array( 83 87 'warnDelete' => __( "You are about to permanently delete these items from your site.\nThis action cannot be undone.\n 'Cancel' to stop, 'OK' to delete." ), 84 88 'dismiss' => __( 'Dismiss this notice.' ), … … 94 98 $scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", array(), false, 1 ); 95 99 did_action( 'init' ) && $scripts->localize( 96 'quicktags', 'quicktagsL10n', array( 100 'quicktags', 101 'quicktagsL10n', 102 array( 97 103 'closeAllOpenTags' => __( 'Close all open tags' ), 98 104 'closeTags' => __( 'close tags' ), … … 136 142 $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array( 'jquery' ), false, 1 ); 137 143 did_action( 'init' ) && $scripts->localize( 138 'wp-ajax-response', 'wpAjax', array( 144 'wp-ajax-response', 145 'wpAjax', 146 array( 139 147 'noPerm' => __( 'Sorry, you are not allowed to do that.' ), 140 148 'broken' => __( 'Something went wrong.' ), … … 145 153 // `wpApiSettings` is also used by `wp-api`, which depends on this script. 146 154 did_action( 'init' ) && $scripts->localize( 147 'wp-api-request', 'wpApiSettings', array( 155 'wp-api-request', 156 'wpApiSettings', 157 array( 148 158 'root' => esc_url_raw( get_rest_url() ), 149 159 'nonce' => ( wp_installing() && ! is_multisite() ) ? '' : wp_create_nonce( 'wp_rest' ), … … 154 164 $scripts->add( 'wp-pointer', "/wp-includes/js/wp-pointer$suffix.js", array( 'jquery-ui-widget', 'jquery-ui-position' ), '20111129a', 1 ); 155 165 did_action( 'init' ) && $scripts->localize( 156 'wp-pointer', 'wpPointerL10n', array( 166 'wp-pointer', 167 'wpPointerL10n', 168 array( 157 169 'dismiss' => __( 'Dismiss' ), 158 170 ) … … 163 175 $scripts->add( 'heartbeat', "/wp-includes/js/heartbeat$suffix.js", array( 'jquery' ), false, 1 ); 164 176 did_action( 'init' ) && $scripts->localize( 165 'heartbeat', 'heartbeatSettings', 177 'heartbeat', 178 'heartbeatSettings', 166 179 /** 167 180 * Filters the Heartbeat settings. … … 176 189 $scripts->add( 'wp-auth-check', "/wp-includes/js/wp-auth-check$suffix.js", array( 'heartbeat' ), false, 1 ); 177 190 did_action( 'init' ) && $scripts->localize( 178 'wp-auth-check', 'authcheckL10n', array( 191 'wp-auth-check', 192 'authcheckL10n', 193 array( 179 194 'beforeunload' => __( 'Your session has expired. You can log in again from this page or go to the login page.' ), 180 195 … … 255 270 // Strings for 'jquery-ui-autocomplete' live region messages 256 271 did_action( 'init' ) && $scripts->localize( 257 'jquery-ui-autocomplete', 'uiAutocompleteL10n', array( 272 'jquery-ui-autocomplete', 273 'uiAutocompleteL10n', 274 array( 258 275 'noResults' => __( 'No results found.' ), 259 276 /* translators: Number of results found when using jQuery UI Autocomplete */ … … 288 305 $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array( 'jquery' ), '3.1-20121105', 1 ); 289 306 did_action( 'init' ) && $scripts->localize( 290 'thickbox', 'thickboxL10n', array( 307 'thickbox', 308 'thickboxL10n', 309 array( 291 310 'next' => __( 'Next >' ), 292 311 'prev' => __( '< Prev' ), … … 359 378 $scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array( 'underscore', 'jquery' ), false, 1 ); 360 379 did_action( 'init' ) && $scripts->localize( 361 'wp-util', '_wpUtilSettings', array( 380 'wp-util', 381 '_wpUtilSettings', 382 array( 362 383 'ajax' => array( 363 384 'url' => admin_url( 'admin-ajax.php', 'relative' ), … … 379 400 380 401 did_action( 'init' ) && $scripts->add_inline_script( 381 'mediaelement-core', sprintf( 382 'var mejsL10n = %s;', wp_json_encode( 402 'mediaelement-core', 403 sprintf( 404 'var mejsL10n = %s;', 405 wp_json_encode( 383 406 array( 384 407 'language' => strtolower( strtok( is_admin() ? get_user_locale() : get_locale(), '_-' ) ), … … 468 491 ) 469 492 ) 470 ), 'before' 493 ), 494 'before' 471 495 ); 472 496 … … 479 503 ); 480 504 did_action( 'init' ) && $scripts->localize( 481 'mediaelement', '_wpmejsSettings', 505 'mediaelement', 506 '_wpmejsSettings', 482 507 /** 483 508 * Filters the MediaElement configuration settings. … … 500 525 $scripts->add( 'wp-theme-plugin-editor', "/wp-admin/js/theme-plugin-editor$suffix.js", array( 'wp-util', 'wp-sanitize', 'jquery', 'jquery-ui-core', 'wp-a11y', 'underscore' ) ); 501 526 did_action( 'init' ) && $scripts->add_inline_script( 502 'wp-theme-plugin-editor', sprintf( 503 'wp.themePluginEditor.l10n = %s;', wp_json_encode( 527 'wp-theme-plugin-editor', 528 sprintf( 529 'wp.themePluginEditor.l10n = %s;', 530 wp_json_encode( 504 531 array( 505 532 'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ), … … 520 547 $scripts->add( 'zxcvbn-async', "/wp-includes/js/zxcvbn-async$suffix.js", array(), '1.0' ); 521 548 did_action( 'init' ) && $scripts->localize( 522 'zxcvbn-async', '_zxcvbnSettings', array( 549 'zxcvbn-async', 550 '_zxcvbnSettings', 551 array( 523 552 'src' => empty( $guessed_url ) ? includes_url( '/js/zxcvbn.min.js' ) : $scripts->base_url . '/wp-includes/js/zxcvbn.min.js', 524 553 ) … … 527 556 $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array( 'jquery', 'zxcvbn-async' ), false, 1 ); 528 557 did_action( 'init' ) && $scripts->localize( 529 'password-strength-meter', 'pwsL10n', array( 558 'password-strength-meter', 559 'pwsL10n', 560 array( 530 561 'unknown' => _x( 'Password strength unknown', 'password strength' ), 531 562 'short' => _x( 'Very weak', 'password strength' ), … … 539 570 $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter', 'wp-util' ), false, 1 ); 540 571 did_action( 'init' ) && $scripts->localize( 541 'user-profile', 'userProfileL10n', array( 572 'user-profile', 573 'userProfileL10n', 574 array( 542 575 'warn' => __( 'Your new password has not been saved.' ), 543 576 'warnWeak' => __( 'Confirm use of weak password' ), … … 558 591 $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 ); 559 592 did_action( 'init' ) && $scripts->localize( 560 'wplink', 'wpLinkL10n', array( 593 'wplink', 594 'wpLinkL10n', 595 array( 561 596 'title' => __( 'Insert/edit link' ), 562 597 'update' => __( 'Update' ), … … 584 619 $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-util', 'jquery-ui-core' ), false, 1 ); 585 620 did_action( 'init' ) && $scripts->localize( 586 'customize-controls', '_wpCustomizeControlsL10n', array( 621 'customize-controls', 622 '_wpCustomizeControlsL10n', 623 array( 587 624 'activate' => __( 'Activate & Publish' ), 588 625 'save' => __( 'Save & Publish' ), // @todo Remove as not required. … … 663 700 $scripts->add( 'media-models', "/wp-includes/js/media-models$suffix.js", array( 'wp-backbone' ), false, 1 ); 664 701 did_action( 'init' ) && $scripts->localize( 665 'media-models', '_wpMediaModelsL10n', array( 702 'media-models', 703 '_wpMediaModelsL10n', 704 array( 666 705 'settings' => array( 667 706 'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ), … … 685 724 $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array( 'jquery', 'wp-ajax-response' ), false, 1 ); 686 725 did_action( 'init' ) && $scripts->localize( 687 'admin-tags', 'tagsl10n', array( 726 'admin-tags', 727 'tagsl10n', 728 array( 688 729 'noPerm' => __( 'Sorry, you are not allowed to do that.' ), 689 730 'broken' => __( 'Something went wrong.' ), … … 693 734 $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array( 'wp-lists', 'quicktags', 'jquery-query' ), false, 1 ); 694 735 did_action( 'init' ) && $scripts->localize( 695 'admin-comments', 'adminCommentsL10n', array( 736 'admin-comments', 737 'adminCommentsL10n', 738 array( 696 739 'hotkeys_highlight_first' => isset( $_GET['hotkeys_highlight_first'] ), 697 740 'hotkeys_highlight_last' => isset( $_GET['hotkeys_highlight_last'] ), … … 708 751 $scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", array( 'jquery' ), false, 1 ); 709 752 did_action( 'init' ) && $scripts->localize( 710 'xfn', 'privacyToolsL10n', array( 753 'xfn', 754 'privacyToolsL10n', 755 array( 711 756 'noDataFound' => __( 'No personal data was found for this user.' ), 712 757 'foundAndRemoved' => __( 'All of the personal data found for this user was erased.' ), … … 721 766 $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array( 'jquery-ui-sortable' ), false, 1 ); 722 767 did_action( 'init' ) && $scripts->localize( 723 'postbox', 'postBoxL10n', array( 768 'postbox', 769 'postBoxL10n', 770 array( 724 771 'postBoxEmptyString' => __( 'Drag boxes here' ), 725 772 ) … … 730 777 $scripts->add( 'tags-suggest', "/wp-admin/js/tags-suggest$suffix.js", array( 'jquery-ui-autocomplete', 'wp-a11y' ), false, 1 ); 731 778 did_action( 'init' ) && $scripts->localize( 732 'tags-suggest', 'tagsSuggestL10n', array( 779 'tags-suggest', 780 'tagsSuggestL10n', 781 array( 733 782 'tagDelimiter' => _x( ',', 'tag delimiter' ), 734 783 'removeTerm' => __( 'Remove term:' ), … … 752 801 $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count', 'wp-a11y' ), false, 1 ); 753 802 did_action( 'init' ) && $scripts->localize( 754 'post', 'postL10n', array( 803 'post', 804 'postL10n', 805 array( 755 806 'ok' => __( 'OK' ), 756 807 'cancel' => __( 'Cancel' ), … … 786 837 $scripts->add_data( 'comment', 'group', 1 ); 787 838 did_action( 'init' ) && $scripts->localize( 788 'comment', 'commentL10n', array( 839 'comment', 840 'commentL10n', 841 array( 789 842 'submittedOn' => __( 'Submitted on:' ), 790 843 /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */ … … 797 850 $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-a11y' ), false, 1 ); 798 851 did_action( 'init' ) && $scripts->add_inline_script( 799 'admin-widgets', sprintf( 800 'wpWidgets.l10n = %s;', wp_json_encode( 852 'admin-widgets', 853 sprintf( 854 'wpWidgets.l10n = %s;', 855 wp_json_encode( 801 856 array( 802 857 'save' => __( 'Save' ), … … 823 878 $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'tags-suggest', 'wp-a11y' ), false, 1 ); 824 879 did_action( 'init' ) && $scripts->localize( 825 'inline-edit-post', 'inlineEditL10n', array( 880 'inline-edit-post', 881 'inlineEditL10n', 882 array( 826 883 'error' => __( 'Error while saving the changes.' ), 827 884 'ntdeltitle' => __( 'Remove From Bulk Edit' ), … … 834 891 $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 ); 835 892 did_action( 'init' ) && $scripts->localize( 836 'inline-edit-tax', 'inlineEditL10n', array( 893 'inline-edit-tax', 894 'inlineEditL10n', 895 array( 837 896 'error' => __( 'Error while saving the changes.' ), 838 897 'saved' => __( 'Changes saved.' ), … … 842 901 $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'jquery-ui-core', 'thickbox' ), false, 1 ); 843 902 did_action( 'init' ) && $scripts->localize( 844 'plugin-install', 'plugininstallL10n', array( 903 'plugin-install', 904 'plugininstallL10n', 905 array( 845 906 'plugin_information' => __( 'Plugin:' ), 846 907 'plugin_modal_label' => __( 'Plugin details' ), … … 851 912 $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y' ), false, 1 ); 852 913 did_action( 'init' ) && $scripts->localize( 853 'updates', '_wpUpdatesSettings', array( 914 'updates', 915 '_wpUpdatesSettings', 916 array( 854 917 'ajax_nonce' => wp_create_nonce( 'updates' ), 855 918 'l10n' => array( … … 942 1005 $scripts->add( 'wp-color-picker', "/wp-admin/js/color-picker$suffix.js", array( 'iris' ), false, 1 ); 943 1006 did_action( 'init' ) && $scripts->localize( 944 'wp-color-picker', 'wpColorPickerL10n', array( 1007 'wp-color-picker', 1008 'wpColorPickerL10n', 1009 array( 945 1010 'clear' => __( 'Clear' ), 946 1011 'clearAriaLabel' => __( 'Clear color' ), … … 959 1024 $scripts->add( 'media', "/wp-admin/js/media$suffix.js", array( 'jquery' ), false, 1 ); 960 1025 did_action( 'init' ) && $scripts->localize( 961 'media', 'attachMediaBoxL10n', array( 1026 'media', 1027 'attachMediaBoxL10n', 1028 array( 962 1029 'error' => __( 'An error has occurred. Please reload the page and try again.' ), 963 1030 ) … … 966 1033 $scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array( 'jquery', 'json2', 'imgareaselect' ), false, 1 ); 967 1034 did_action( 'init' ) && $scripts->localize( 968 'image-edit', 'imageEditL10n', array( 1035 'image-edit', 1036 'imageEditL10n', 1037 array( 969 1038 'error' => __( 'Could not load the preview image. Please reload the page and try again.' ), 970 1039 ) … … 973 1042 $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 ); 974 1043 did_action( 'init' ) && $scripts->localize( 975 'set-post-thumbnail', 'setPostThumbnailL10n', array( 1044 'set-post-thumbnail', 1045 'setPostThumbnailL10n', 1046 array( 976 1047 'setThumbnail' => __( 'Use as featured image' ), 977 1048 'saving' => __( 'Saving...' ), // no ellipsis … … 984 1055 $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-lists', 'postbox', 'json2' ) ); 985 1056 did_action( 'init' ) && $scripts->localize( 986 'nav-menu', 'navMenuL10n', array( 1057 'nav-menu', 1058 'navMenuL10n', 1059 array( 987 1060 'noResultsFound' => __( 'No results found.' ), 988 1061 'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ), … … 1205 1278 1206 1279 wp_localize_script( 1207 'autosave', 'autosaveL10n', array( 1280 'autosave', 1281 'autosaveL10n', 1282 array( 1208 1283 'autosaveInterval' => AUTOSAVE_INTERVAL, 1209 1284 'blog_id' => get_current_blog_id(), … … 1212 1287 1213 1288 wp_localize_script( 1214 'mce-view', 'mceViewL10n', array( 1289 'mce-view', 1290 'mceViewL10n', 1291 array( 1215 1292 'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array(), 1216 1293 ) … … 1218 1295 1219 1296 wp_localize_script( 1220 'word-count', 'wordCountL10n', array( 1297 'word-count', 1298 'wordCountL10n', 1299 array( 1221 1300 /* 1222 1301 * translators: If your word count is based on single characters (e.g. East Asian characters), … … 1327 1406 1328 1407 wp_localize_script( 1329 'dashboard', 'communityEventsData', array( 1408 'dashboard', 1409 'communityEventsData', 1410 array( 1330 1411 'nonce' => wp_create_nonce( 'community_events' ), 1331 1412 'cache' => $events_client->get_cached_events(),
Note: See TracChangeset
for help on using the changeset viewer.