do_action( 'enqueue_block_editor_assets'
);
// In order to duplicate classic meta box behavior, we need to run the classic meta box actions.
require_once ABSPATH . 'wp-admin/includes/meta-boxes.php';
register_and_do_post_meta_boxes( $post );
// Check if the Custom Fields meta box has been removed at some point.
$core_meta_boxes =
$wp_meta_boxes[ $current_screen->id
]['normal'
]['core'
];
if ( !
isset( $core_meta_boxes['postcustom'
] ) || !
$core_meta_boxes['postcustom'
] ) { unset( $editor_settings['enableCustomFields'
] );
}$editor_settings =
get_block_editor_settings( $editor_settings,
$block_editor_context );
$init_script = <<<JS
( function() {
window._wpLoadBlockEditor = new Promise( function( resolve ) {
wp.domReady( function() {
resolve( wp.editPost.initializeEditor( 'editor', "%s", %d, %s, %s ) );
} );
} );
} )();