diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index 29a77af00d..9df2bad2c3 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -534,19 +534,19 @@ add_action( 'wp_default_scripts', 'wp_default_scripts' ); add_action( 'wp_default_scripts', 'wp_default_packages' ); add_action( 'wp_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 ); -add_action( 'admin_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 ); add_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' ); +add_action( 'admin_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 ); add_action( 'admin_enqueue_scripts', 'wp_common_block_scripts_and_styles' ); add_action( 'enqueue_block_assets', 'wp_enqueue_registered_block_scripts_and_styles' ); -add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_format_library_assets' ); +add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 ); add_action( 'enqueue_block_editor_assets', 'wp_enqueue_registered_block_scripts_and_styles' ); +add_action( 'enqueue_block_editor_assets', 'enqueue_editor_block_styles_assets' ); +add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' ); +add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_format_library_assets' ); add_action( 'admin_print_scripts-index.php', 'wp_localize_community_events' ); add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' ); add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' ); add_filter( 'customize_controls_print_styles', 'wp_resource_hints', 1 ); -add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 ); -add_action( 'enqueue_block_editor_assets', 'enqueue_editor_block_styles_assets' ); -add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' ); add_action( 'wp_default_styles', 'wp_default_styles' ); add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 ); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 62bbda090c..2d18f87415 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -2323,16 +2323,6 @@ function enqueue_editor_block_styles_assets() { wp_enqueue_script( 'wp-block-styles' ); } -/** - * Enqueues the assets required for the format library within the block editor. - * - * @since 5.8.0 - */ -function wp_enqueue_editor_format_library_assets() { - wp_enqueue_script( 'wp-format-library' ); - wp_enqueue_style( 'wp-format-library' ); -} - /** * Enqueues the assets required for the block directory within the block editor. * @@ -2343,6 +2333,16 @@ function wp_enqueue_editor_block_directory_assets() { wp_enqueue_style( 'wp-block-directory' ); } +/** + * Enqueues the assets required for the format library within the block editor. + * + * @since 5.8.0 + */ +function wp_enqueue_editor_format_library_assets() { + wp_enqueue_script( 'wp-format-library' ); + wp_enqueue_style( 'wp-format-library' ); +} + /** * Sanitizes an attributes array into an attributes string to be placed inside a `