Make WordPress Core


Ignore:
Timestamp:
03/17/2022 03:35:13 AM (2 years ago)
Author:
noisysocks
Message:

Add WP_Block_Editor_Context::$name

Adds a new WP_Block_Editor_Context::$name and field. This allows plugin
developers to tell which block editor is being loaded when using filters such as
allowed_block_types_all and block_editor_rest_api_preload_paths.

Fixes #55301.
Props talldanwp, gziolo, andraganescu.

File:
1 edited

Legend:

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

    r52622 r52942  
    839839
    840840        if ( wp_use_widgets_block_editor() ) {
    841             $block_editor_context = new WP_Block_Editor_Context();
     841            $block_editor_context = new WP_Block_Editor_Context(
     842                array(
     843                    'name' => 'core/customize-widgets',
     844                )
     845            );
    842846
    843847            $editor_settings = get_block_editor_settings(
Note: See TracChangeset for help on using the changeset viewer.