From 7f222a7159c80e4157544804d7715de1fea6096c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 22 Dec 2021 12:58:42 +0000 Subject: [PATCH] Editor: Add missing default template areas to the post/page editor settings. This ensures that default template area settings are displayed when editing a template in the post/page editor, which previously got lost during backporting for 5.9. Follow-up to [52232]. Props Mamaduka, costdev, gziolo. Fixes #54679. git-svn-id: https://develop.svn.wordpress.org/trunk@52409 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit-form-blocks.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index f85503d575..e05be4c356 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -229,6 +229,10 @@ if ( $is_new_post && ! isset( $editor_settings['template'] ) && 'post' === $post } } +if ( wp_is_block_theme() && $editor_settings['supportsTemplateMode'] ) { + $editor_settings['defaultTemplatePartAreas'] = get_allowed_block_template_part_areas(); +} + /** * Scripts */