Skip to content

View Config: Show the placeholder of empty excerpt, description, and author fields - #15120

Closed
oandregal wants to merge 5 commits into
WordPress:trunkfrom
oandregal:update/excerpt-placeholder-if-empty
Closed

oandregal wants to merge 5 commits into
WordPress:trunkfrom
oandregal:update/excerpt-placeholder-if-empty

Conversation

@oandregal

@oandregal oandregal commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Trac ticket: https://core.trac.wordpress.org/ticket/65981

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 can be edited until they hovered it:

  • excerpt, in the default post type form and in the wp_block form: "(No excerpt)", or "(No description)" for patterns.
  • description, in the wp_template form: "(No description)".
  • author, in the default post type form and in the attachment form: "(No author)", 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.

The REST schema of the endpoint already allows showPlaceholderIfEmpty. The muted styling of the placeholder and the new placeholder strings ship with the @wordpress/dataviews and @wordpress/core-fields package updates.

Backports

Gutenberg PRs:

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 5.5
Used for: Porting the change and its tests from the Gutenberg PR. Reviewed and edited by me.

This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@oandregal oandregal self-assigned this Nov 4, 2026
@oandregal oandregal changed the title View Config: Show the placeholder of an empty excerpt View Config: Show the placeholder of empty excerpt, description, and author fields Nov 4, 2026
@oandregal
oandregal marked this pull request as ready for review November 4, 2026 10:57
Copilot AI balanced review requested due to automatic review settings November 4, 2026 10:57
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props oandregal, jorgefilipecosta.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are blocking the editor summary placeholder changes.

No open issues 🎉

What changed in this PR

Updates editor summary panels to show placeholders for empty excerpt, description, and author fields, making their editability clearer. DataViews lists remain unchanged.

Changes:

  • Enables showPlaceholderIfEmpty for the relevant default, pattern, template, and attachment form fields.
  • Adds PHPUnit coverage for placeholder configuration and updates the expected attachment form structure.
File Description
tests/​phpunit/​tests/​view-config.php Tests placeholder settings across supported forms and updates attachment expectations.
src/​wp-includes/​view-config.php Enables placeholders for empty excerpt, description, and author panel fields.

Review effort: Balanced

Comment thread src/wp-includes/view-config.php Resolved
Comment thread tests/phpunit/tests/view-config.php Resolved

@jorgefilipecosta jorgefilipecosta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me 👍 Tests pass locally, and the REST endpoint returns the new layout for the forms that list the fields.

oandregal and others added 5 commits November 5, 2026 10:43
Turns on the panel layout's `showPlaceholderIfEmpty` option for the `excerpt` field in the default post type form and in the `wp_block` form, so an empty excerpt row shows "Add an excerpt" (or "Add a description" for patterns) instead of only its label.

See #65981.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Turns on the panel layout's `showPlaceholderIfEmpty` option for the `description` field in the `wp_template` form, so an empty description row shows the field's placeholder instead of only its label, like the excerpt of posts and patterns.

See #65981.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Turns on the panel layout's `showPlaceholderIfEmpty` option for the `author` field in the default post type form and in the `attachment` form, so a post or media item without a known author shows the field's placeholder instead of only its label, as the post summary did before it moved to the form.

See #65981.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…holders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r tests.

`WP_UnitTestCase_Base::set_up()` already resets post types before each test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oandregal
oandregal force-pushed the update/excerpt-placeholder-if-empty branch from 1476d54 to 215e5f4 Compare November 5, 2026 09:43
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 65273
GitHub commit: c5d7a00

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Nov 5, 2026
@oandregal
oandregal deleted the update/excerpt-placeholder-if-empty branch November 5, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants