From 0d3573d58bddda76dbf09dd6425559b3738979da Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Thu, 27 Feb 2025 23:10:23 +0000 Subject: [PATCH] Editor: Set new default rendering mode for Pages. This update updates the `page` post-type definition and sets `template-locked` as the new default rendering mode for the block editor. Props mamaduka, wildworks, joemcgill, tyb, swissspidy, audrasjb. Fixes #61811. Built from https://develop.svn.wordpress.org/trunk@59885 git-svn-id: http://core.svn.wordpress.org/trunk@59227 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 58504e140a..a9992071f0 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -69,6 +69,11 @@ function create_initial_post_types() { ) ); + // Enhance page editor for block themes by rendering template and content blocks. + if ( wp_is_block_theme() && current_theme_supports( 'block-templates' ) ) { + add_post_type_support( 'page', 'editor', array( 'default-mode' => 'template-locked' ) ); + } + register_post_type( 'attachment', array( diff --git a/wp-includes/version.php b/wp-includes/version.php index ca7a94ea40..e92d3839a0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59884'; +$wp_version = '6.8-alpha-59885'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.