Site Editor: Render the template descriptions properly.

The initializaion of the editor was a bit different between Gutenberg and Core.
This brings them in sync which solves the missing descriptions from the template header
in the site editor.

See #54337.


git-svn-id: https://develop.svn.wordpress.org/trunk@52336 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Riad Benguella 2021-12-07 16:38:47 +00:00
parent e205409fb3
commit eb1763d2af

View File

@ -37,12 +37,18 @@ add_filter(
}
);
$indexed_template_types = array();
foreach ( get_default_block_template_types() as $slug => $template_type ) {
$template_type['slug'] = (string) $slug;
$indexed_template_types[] = $template_type;
}
$block_editor_context = new WP_Block_Editor_Context();
$custom_settings = array(
'siteUrl' => site_url(),
'postsPerPage' => get_option( 'posts_per_page' ),
'styles' => get_block_editor_theme_styles(),
'defaultTemplateTypes' => get_default_block_template_types(),
'defaultTemplateTypes' => $indexed_template_types,
'defaultTemplatePartAreas' => get_allowed_block_template_part_areas(),
'__experimentalBlockPatterns' => WP_Block_Patterns_Registry::get_instance()->get_all_registered(),
'__experimentalBlockPatternCategories' => WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered(),