mirror of
git://develop.git.wordpress.org/
synced 2025-04-13 00:22:52 +02: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:
parent
976de7bdfb
commit
6b3019b03e
@ -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'
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user