Editor: Use the block editor context in filters that used the editor name

Follow-up for [50956].
Props azaozz, chrisvanpatten, timothyblynjacobs, youknowriad.
Fixes #52920.



git-svn-id: https://develop.svn.wordpress.org/trunk@50983 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Greg Ziółkowski
2021-05-24 21:20:31 +00:00
parent 479ea22b8e
commit b589f04a03
3 changed files with 54 additions and 45 deletions
+1 -2
View File
@@ -23,7 +23,6 @@ if ( ! defined( 'ABSPATH' ) ) {
*/
global $post_type, $post_type_object, $post, $title, $editor_styles, $wp_meta_boxes;
$editor_name = 'post-editor';
$block_editor_context = new WP_Block_Editor_Context( array( 'post' => $post ) );
// Flag that we're loading the block editor.
@@ -280,7 +279,7 @@ if ( ! isset( $core_meta_boxes['postcustom'] ) || ! $core_meta_boxes['postcustom
unset( $editor_settings['enableCustomFields'] );
}
$editor_settings = get_block_editor_settings( $editor_name, $editor_settings );
$editor_settings = get_block_editor_settings( $editor_settings, $block_editor_context );
$init_script = <<<JS
( function() {