From ec25c4ee57becff141a88ec2670688af7b8a66f0 Mon Sep 17 00:00:00 2001 From: youknowriad Date: Tue, 7 Dec 2021 16:40:01 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@52336 git-svn-id: http://core.svn.wordpress.org/trunk@51928 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/site-editor.php | 8 +++++++- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/wp-admin/site-editor.php b/wp-admin/site-editor.php index 64abbdb0cd..6100f5a310 100644 --- a/wp-admin/site-editor.php +++ b/wp-admin/site-editor.php @@ -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(), diff --git a/wp-includes/version.php b/wp-includes/version.php index 0338c2135a..5dceb620a3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-beta1-52335'; +$wp_version = '5.9-beta1-52336'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.