mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 00:01:27 +01:00
Editor: Ensure the required assets for the block directory are enqueued.
This fixes an issue where the block directory appears unstyled due to the stylesheets not being enqueued. Props ryelle, timothyblynjacobs, earnjam. Fixes #50661. Built from https://develop.svn.wordpress.org/trunk@48537 git-svn-id: http://core.svn.wordpress.org/trunk@48299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
12daeec1f7
commit
3dda74c337
@ -365,14 +365,13 @@ wp_enqueue_media(
|
|||||||
);
|
);
|
||||||
wp_tinymce_inline_scripts();
|
wp_tinymce_inline_scripts();
|
||||||
wp_enqueue_editor();
|
wp_enqueue_editor();
|
||||||
wp_enqueue_script( 'wp-block-directory' );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Styles
|
* Styles
|
||||||
*/
|
*/
|
||||||
wp_enqueue_style( 'wp-edit-post' );
|
wp_enqueue_style( 'wp-edit-post' );
|
||||||
wp_enqueue_style( 'wp-format-library' );
|
wp_enqueue_style( 'wp-format-library' );
|
||||||
wp_enqueue_style( 'wp-block-directory' );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires after block assets have been enqueued for the editing interface.
|
* Fires after block assets have been enqueued for the editing interface.
|
||||||
|
@ -516,6 +516,7 @@ add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );
|
|||||||
add_filter( 'customize_controls_print_styles', 'wp_resource_hints', 1 );
|
add_filter( 'customize_controls_print_styles', 'wp_resource_hints', 1 );
|
||||||
add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 );
|
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', '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_action( 'wp_default_styles', 'wp_default_styles' );
|
||||||
add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 );
|
add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 );
|
||||||
|
@ -1463,6 +1463,7 @@ function wp_default_styles( $styles ) {
|
|||||||
'wp-editor-font',
|
'wp-editor-font',
|
||||||
),
|
),
|
||||||
'block-library' => array(),
|
'block-library' => array(),
|
||||||
|
'block-directory' => array(),
|
||||||
'components' => array(),
|
'components' => array(),
|
||||||
'edit-post' => array(
|
'edit-post' => array(
|
||||||
'wp-components',
|
'wp-components',
|
||||||
@ -1527,6 +1528,7 @@ function wp_default_styles( $styles ) {
|
|||||||
'wp-edit-blocks',
|
'wp-edit-blocks',
|
||||||
'wp-block-editor',
|
'wp-block-editor',
|
||||||
'wp-block-library',
|
'wp-block-library',
|
||||||
|
'wp-block-directory',
|
||||||
'wp-components',
|
'wp-components',
|
||||||
'wp-edit-post',
|
'wp-edit-post',
|
||||||
'wp-editor',
|
'wp-editor',
|
||||||
@ -2269,3 +2271,13 @@ function enqueue_editor_block_styles_assets() {
|
|||||||
wp_add_inline_script( 'wp-block-styles', $inline_script );
|
wp_add_inline_script( 'wp-block-styles', $inline_script );
|
||||||
wp_enqueue_script( 'wp-block-styles' );
|
wp_enqueue_script( 'wp-block-styles' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enqueues the assets required for the block directory within the block editor.
|
||||||
|
*
|
||||||
|
* @since 5.5.0
|
||||||
|
*/
|
||||||
|
function wp_enqueue_editor_block_directory_assets() {
|
||||||
|
wp_enqueue_script( 'wp-block-directory' );
|
||||||
|
wp_enqueue_style( 'wp-block-directory' );
|
||||||
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.5-beta2-48536';
|
$wp_version = '5.5-beta2-48537';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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