Changeset 44163 for trunk/src/wp-includes/script-loader.php
- Timestamp:
- 12/14/2018 04:42:55 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43801,43803
- Property svn:mergeinfo changed
-
trunk/src/wp-includes/script-loader.php
r44162 r44163 167 167 168 168 $packages_dependencies = array( 169 'api-fetch' => array( 'wp-polyfill', 'wp-hooks', 'wp-i18n' ),169 'api-fetch' => array( 'wp-polyfill', 'wp-hooks', 'wp-i18n', 'wp-url' ), 170 170 'a11y' => array( 'wp-dom-ready', 'wp-polyfill' ), 171 171 'autop' => array( 'wp-polyfill' ), … … 963 963 'mejs.download-video' => __( 'Download Video' ), 964 964 'mejs.fullscreen' => __( 'Fullscreen' ), 965 'mejs.time-jump-forward' => array( __( 'Jump forward 1 second' ), __( 'Jump forward %1 seconds' ) ), 965 966 'mejs.loop' => __( 'Toggle Loop' ), 966 967 'mejs.play' => __( 'Play' ), … … 969 970 'mejs.time-slider' => __( 'Time Slider' ), 970 971 'mejs.time-help-text' => __( 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.' ), 972 'mejs.time-skip-back' => array( __( 'Skip back 1 second' ), __( 'Skip back %1 seconds' ) ), 971 973 'mejs.captions-subtitles' => __( 'Captions/Subtitles' ), 972 974 'mejs.captions-chapters' => __( 'Chapters' ), … … 980 982 'mejs.audio-player' => __( 'Audio Player' ), 981 983 'mejs.ad-skip' => __( 'Skip ad' ), 984 'mejs.ad-skip-info' => array( __( 'Skip in 1 second' ), __( 'Skip in %1 seconds' ) ), 982 985 'mejs.source-chooser' => __( 'Source Chooser' ), 983 986 'mejs.stop' => __( 'Stop' ), … … 1068 1071 $scripts->add( 'wp-codemirror', '/wp-includes/js/codemirror/codemirror.min.js', array(), '5.29.1-alpha-ee20357' ); 1069 1072 $scripts->add( 'csslint', '/wp-includes/js/codemirror/csslint.js', array(), '1.0.5' ); 1070 $scripts->add( 'jshint', '/wp-includes/js/codemirror/fakejshint.js', array( 'esprima' ), '2.9.5' ); 1071 $scripts->add( 'esprima', '/wp-includes/js/codemirror/esprima.js', array(), '4.0.0' ); 1073 $scripts->add( 'jshint', '/wp-includes/js/codemirror/jshint.js', array(), '2.9.5.999' ); 1072 1074 $scripts->add( 'jsonlint', '/wp-includes/js/codemirror/jsonlint.js', array(), '1.6.2' ); 1073 1075 $scripts->add( 'htmlhint', '/wp-includes/js/codemirror/htmlhint.js', array(), '0.9.14-xwp' ); … … 1228 1230 'themeInstallUnavailable' => sprintf( 1229 1231 /* translators: %s: URL to Add Themes admin screen */ 1230 __( 'You won’t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ),1232 __( 'You won’t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ), 1231 1233 esc_url( admin_url( 'theme-install.php' ) ) 1232 1234 ), … … 1336 1338 'termAdded' => __( 'Term added.' ), 1337 1339 'termRemoved' => __( 'Term removed.' ), 1338 'restURL' => rest_url( '/wp/v2/tags' ),1339 1340 /**1341 * Filters the minimum number of characters required to fire a tag search via Ajax.1342 *1343 * Previous to 5.0.0, this filter passed taxonomy and search context parameters.1344 * @since 4.0.01345 *1346 * @param int $characters The minimum number of characters required. Default 2.1347 */1348 'minChars' => (int) apply_filters( 'term_search_min_chars', 2 ),1349 1340 ) 1350 1341 ); … … 1399 1390 $scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ) ); 1400 1391 1401 $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' , 'wp-a11y'), false, 1 );1392 $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), false, 1 ); 1402 1393 did_action( 'init' ) && $scripts->add_inline_script( 1403 1394 'admin-widgets', … … 1406 1397 wp_json_encode( 1407 1398 array( 1408 'save' => __( 'Save' ), 1409 'saved' => __( 'Saved' ), 1410 'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ), 1411 'widgetAdded' => __( 'Widget has been added to the selected sidebar' ), 1399 'save' => __( 'Save' ), 1400 'saved' => __( 'Saved' ), 1401 'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ), 1412 1402 ) 1413 1403 ) … … 2417 2407 } 2418 2408 } 2419 2420 /**2421 * Handles the enqueueing of block scripts and styles that are common to both2422 * the editor and the front-end.2423 *2424 * @since 5.0.02425 *2426 * @global WP_Screen $current_screen2427 */2428 function wp_common_block_scripts_and_styles() {2429 global $current_screen;2430 2431 if ( is_admin() && ! $current_screen->is_block_editor() ) {2432 return;2433 }2434 2435 wp_enqueue_style( 'wp-block-library' );2436 2437 if ( current_theme_supports( 'wp-block-styles' ) ) {2438 wp_enqueue_style( 'wp-block-library-theme' );2439 }2440 2441 /**2442 * Fires after enqueuing block assets for both editor and front-end.2443 *2444 * Call `add_action` on any hook before 'wp_enqueue_scripts'.2445 *2446 * In the function call you supply, simply use `wp_enqueue_script` and2447 * `wp_enqueue_style` to add your functionality to the Gutenberg editor.2448 *2449 * @since 5.0.02450 */2451 do_action( 'enqueue_block_assets' );2452 }2453 2454 /**2455 * Enqueues registered block scripts and styles, depending on current rendered2456 * context (only enqueuing editor scripts while in context of the editor).2457 *2458 * @since 5.0.02459 *2460 * @global WP_Screen $current_screen2461 */2462 function wp_enqueue_registered_block_scripts_and_styles() {2463 global $current_screen;2464 2465 $is_editor = ( is_admin() && $current_screen->is_block_editor() );2466 2467 $block_registry = WP_Block_Type_Registry::get_instance();2468 foreach ( $block_registry->get_all_registered() as $block_name => $block_type ) {2469 // Front-end styles.2470 if ( ! empty( $block_type->style ) ) {2471 wp_enqueue_style( $block_type->style );2472 }2473 2474 // Front-end script.2475 if ( ! empty( $block_type->script ) ) {2476 wp_enqueue_script( $block_type->script );2477 }2478 2479 // Editor styles.2480 if ( $is_editor && ! empty( $block_type->editor_style ) ) {2481 wp_enqueue_style( $block_type->editor_style );2482 }2483 2484 // Editor script.2485 if ( $is_editor && ! empty( $block_type->editor_script ) ) {2486 wp_enqueue_script( $block_type->editor_script );2487 }2488 }2489 }
Note: See TracChangeset
for help on using the changeset viewer.