Make WordPress Core


Ignore:
Timestamp:
08/31/2021 01:37:31 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r51423 r51700  
    863863            wp_add_inline_script(
    864864                'wp-blocks',
    865                 sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( 'widgets-customizer' ) ) ),
     865                sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $block_editor_context ) ) ),
    866866                'after'
    867867            );
Note: See TracChangeset for help on using the changeset viewer.