mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. Fixes #53757. git-svn-id: https://develop.svn.wordpress.org/trunk@51700 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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'
|
||||
);
|
||||
|
||||
|
||||
@@ -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'
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user