Site Editor: Pass correct context into get_block_categories

Site Editor passed incorrectly global $post as a context when setting up block categories. Instead, it should pass $block_editor_context, since global $post is null in this file.

Props Mamaduka.
Fixes #56284.


Built from https://develop.svn.wordpress.org/trunk@53784


git-svn-id: http://core.svn.wordpress.org/trunk@53343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
gziolo 2022-07-27 12:27:16 +00:00
parent 7af37ed1ad
commit db37be017f
2 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@
* @subpackage Administration
*/
global $post, $editor_styles;
global $editor_styles;
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
@ -120,7 +120,7 @@ wp_add_inline_script(
wp_add_inline_script(
'wp-blocks',
sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $post ) ) ),
sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( isset( $editor_settings['blockCategories'] ) ? $editor_settings['blockCategories'] : array() ) ),
'after'
);

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-53783';
$wp_version = '6.1-alpha-53784';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.