mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@53784 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d5fe7bcf45
commit
52f51f5cdf
@ -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'
|
||||
);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user