Commit 134bf06ec2 for wordpress.org
commit 134bf06ec27e88cd99641eaa3b2f0bbc4bd8b622
Author: oandregal <oandregal@git.wordpress.org>
Date: Thu Nov 5 09:52:01 2026 +0000
Editor: Show the placeholder of empty excerpt, description, and author fields.
Turns on the panel layout's `showPlaceholderIfEmpty` option in `view-config.php` for the fields that render nothing when empty, so their row in the editor's summary panel shows the field's placeholder instead of only its label, which gave users no hint the row could be edited until they hovered it:
- `excerpt`, in the default post type form and in the `wp_block` form.
- `description`, in the `wp_template` form.
- `author`, in the default post type form and in the `attachment` form, for a post or media item without a known author, as the post summary did before it moved to the form.
DataViews lists are not affected, since the placeholder only shows in the panel summary.
Backports the changes from https://github.com/WordPress/gutenberg/pull/85842.
Props oandregal, jorgefilipecosta, 0mirka00.
Fixes #65981.
Built from https://develop.svn.wordpress.org/trunk@65273
git-svn-id: http://core.svn.wordpress.org/trunk@64422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/version.php b/wp-includes/version.php
index b03f214a0c..1576f5ac55 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-beta4-65272';
+$wp_version = '7.2-beta4-65273';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
diff --git a/wp-includes/view-config.php b/wp-includes/view-config.php
index ebf3dd3dc5..f0448d9764 100644
--- a/wp-includes/view-config.php
+++ b/wp-includes/view-config.php
@@ -45,6 +45,7 @@ function wp_get_entity_view_config_hook_name( $kind, $name ) {
* returns `false`.
*
* @since 7.1.0
+ * @since 7.2.0 Shows a placeholder for an empty excerpt and a missing author.
*
* @return array The default form configuration.
*/
@@ -69,8 +70,9 @@ function _wp_get_default_posttype_form() {
array(
'id' => 'excerpt',
'layout' => array(
- 'type' => 'panel',
- 'labelPosition' => 'top',
+ 'type' => 'panel',
+ 'labelPosition' => 'top',
+ 'showPlaceholderIfEmpty' => true,
),
),
array(
@@ -95,7 +97,13 @@ function _wp_get_default_posttype_form() {
),
'date',
'slug',
- 'author',
+ array(
+ 'id' => 'author',
+ 'layout' => array(
+ 'type' => 'panel',
+ 'showPlaceholderIfEmpty' => true,
+ ),
+ ),
'template',
array(
'id' => 'discussion',
@@ -331,6 +339,7 @@ function _wp_get_entity_view_config_posttype_page( $data ) {
* Provides the view configuration for the `wp_block` post type.
*
* @since 7.1.0
+ * @since 7.2.0 Shows a placeholder for an empty excerpt.
*
* @param WP_View_Config_Data $data The view configuration container for the entity.
* @return WP_View_Config_Data The updated view configuration container.
@@ -417,8 +426,9 @@ function _wp_get_entity_view_config_posttype_wp_block( $data ) {
array(
'id' => 'excerpt',
'layout' => array(
- 'type' => 'panel',
- 'labelPosition' => 'top',
+ 'type' => 'panel',
+ 'labelPosition' => 'top',
+ 'showPlaceholderIfEmpty' => true,
),
),
array(
@@ -552,6 +562,7 @@ function _wp_get_entity_view_config_posttype_wp_template_part( $data ) {
* Provides the view configuration for the `wp_template` post type.
*
* @since 7.1.0
+ * @since 7.2.0 Shows a placeholder for an empty description.
*
* @param WP_View_Config_Data $data The view configuration container for the entity.
* @return WP_View_Config_Data The updated view configuration container.
@@ -722,8 +733,9 @@ function _wp_get_entity_view_config_posttype_wp_template( $data ) {
array(
'id' => 'description',
'layout' => array(
- 'type' => 'panel',
- 'labelPosition' => 'top',
+ 'type' => 'panel',
+ 'labelPosition' => 'top',
+ 'showPlaceholderIfEmpty' => true,
),
),
array(
@@ -813,7 +825,13 @@ function _wp_get_entity_view_config_posttype_attachment( $data ) {
'layout' => $regular_layout,
),
'date',
- 'author',
+ array(
+ 'id' => 'author',
+ 'layout' => array(
+ 'type' => 'panel',
+ 'showPlaceholderIfEmpty' => true,
+ ),
+ ),
'filename',
'mime_type',
'filesize',