Make WordPress Core

Changeset 50629


Ignore:
Timestamp:
04/01/2021 11:44:54 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Editor: Consolidate enqueueing block editor assets in wp-includes/default-filters.php.

Follow-up to [44157], [46111], [48537], [50620].

See #52920.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r50620 r50629  
    535535
    536536add_action( 'wp_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 );
     537add_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
    537538add_action( 'admin_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 );
    538 add_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
    539539add_action( 'admin_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
    540540add_action( 'enqueue_block_assets', 'wp_enqueue_registered_block_scripts_and_styles' );
     541add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 );
     542add_action( 'enqueue_block_editor_assets', 'wp_enqueue_registered_block_scripts_and_styles' );
     543add_action( 'enqueue_block_editor_assets', 'enqueue_editor_block_styles_assets' );
     544add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
    541545add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_format_library_assets' );
    542 add_action( 'enqueue_block_editor_assets', 'wp_enqueue_registered_block_scripts_and_styles' );
    543546add_action( 'admin_print_scripts-index.php', 'wp_localize_community_events' );
    544547add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' );
    545548add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );
    546549add_filter( 'customize_controls_print_styles', 'wp_resource_hints', 1 );
    547 add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 );
    548 add_action( 'enqueue_block_editor_assets', 'enqueue_editor_block_styles_assets' );
    549 add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
    550550
    551551add_action( 'wp_default_styles', 'wp_default_styles' );
  • trunk/src/wp-includes/script-loader.php

    r50620 r50629  
    23252325
    23262326/**
     2327 * Enqueues the assets required for the block directory within the block editor.
     2328 *
     2329 * @since 5.5.0
     2330 */
     2331function wp_enqueue_editor_block_directory_assets() {
     2332    wp_enqueue_script( 'wp-block-directory' );
     2333    wp_enqueue_style( 'wp-block-directory' );
     2334}
     2335
     2336/**
    23272337 * Enqueues the assets required for the format library within the block editor.
    23282338 *
     
    23322342    wp_enqueue_script( 'wp-format-library' );
    23332343    wp_enqueue_style( 'wp-format-library' );
    2334 }
    2335 
    2336 /**
    2337  * Enqueues the assets required for the block directory within the block editor.
    2338  *
    2339  * @since 5.5.0
    2340  */
    2341 function wp_enqueue_editor_block_directory_assets() {
    2342     wp_enqueue_script( 'wp-block-directory' );
    2343     wp_enqueue_style( 'wp-block-directory' );
    23442344}
    23452345
Note: See TracChangeset for help on using the changeset viewer.