Widgets: Pass correct context to `get_block_categories()` calls.

The `get_block_categories()` function expects either a `WP_Post` or a `WP_Block_Editor_Context` instance as the context argument, not a string.

Follow-up to [50996], [50997].

Props Enchiridion, pbearne, audrasjb, SergeyBiryukov.
Merges [51700] to the 5.8 branch.
Fixes #53757.
Built from https://develop.svn.wordpress.org/branches/5.8@51711


git-svn-id: http://core.svn.wordpress.org/branches/5.8@51317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2021-09-01 00:34:58 +00:00
parent a80100db11
commit cc684968ae
3 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ wp_add_inline_script(
wp_add_inline_script(
'wp-blocks',
sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( 'widgets-editor' ) ) ),
sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $block_editor_context ) ) ),
'after'
);

View File

@ -862,7 +862,7 @@ final class WP_Customize_Widgets {
wp_add_inline_script(
'wp-blocks',
sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( 'widgets-customizer' ) ) ),
sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $block_editor_context ) ) ),
'after'
);

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8.1-alpha-51710';
$wp_version = '5.8.1-alpha-51711';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.