Loading assets for the editor: Revert [55695].
The changeset [55695] introduced a regression in the order of styles for the editor, causing the styles registered for the block (both editor and front) to be loaded after any other styles enqueued using the `enqueue_block_editor_assets` hook. Since the original behavior was introduced in WordPress 5.0 changing it breaks the expectations of the ecosystem. Props ellatrix. Fixes #58208. Built from https://develop.svn.wordpress.org/trunk@55852 git-svn-id: http://core.svn.wordpress.org/trunk@55364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0ecaf73f34
commit
7311e69b59
@ -571,6 +571,20 @@ add_action( 'admin_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 );
|
|||||||
add_action( 'admin_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
|
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_assets', 'wp_enqueue_registered_block_scripts_and_styles' );
|
||||||
add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 );
|
add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 );
|
||||||
|
/*
|
||||||
|
* `wp_enqueue_registered_block_scripts_and_styles` is bound to both
|
||||||
|
* `enqueue_block_editor_assets` and `enqueue_block_assets` hooks
|
||||||
|
* since the introduction of the block editor in WordPress 5.0.
|
||||||
|
*
|
||||||
|
* The way this works is that the block assets are loaded before any other assets.
|
||||||
|
* For example, this is the order of styles for the editor:
|
||||||
|
*
|
||||||
|
* - front styles registered for blocks, via `styles` handle (block.json)
|
||||||
|
* - editor styles registered for blocks, via `editorStyles` handle (block.json)
|
||||||
|
* - editor styles enqueued via `enqueue_block_editor_assets` hook
|
||||||
|
* - front styles enqueued via `enqueue_block_assets` hook
|
||||||
|
*/
|
||||||
|
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', '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_block_directory_assets' );
|
||||||
add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_format_library_assets' );
|
add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_format_library_assets' );
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.3-alpha-55851';
|
$wp_version = '6.3-alpha-55852';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user