Display excerpt or content snippet alongside "(no title)" fallback#79012
Display excerpt or content snippet alongside "(no title)" fallback#79012sarthaknagoshe2002 wants to merge 3 commits into
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What?
Closes #78897
This PR enhances the
(no title)fallback across Gutenberg's interfaces (DataViews, Media Library, and Editor sidebars) by automatically appending a truncated snippet of the post's excerpt or content to help identify untitled posts.Why?
Currently, posts or pages without a title display simply as
(no title). When dealing with multiple untitled drafts, it becomes impossible for users to distinguish between them in DataViews lists, parent page comboboxes, or the media library. This PR solves the Gutenberg equivalent of WordPress Core Trac ticket #65022 by providing context to titleless entities.How?
parent.js) and DataViews Parent picker (parent-edit.tsx) to explicitly requestexcerpt,contentin their REST API_fieldsqueries so the fallback utilities have data to extract.packages/media-fields/src/attached_to/view.tsxto leverage_embeddedexcerpt and content data so the right-hand sidebar correctly identifies untitled attached posts. (Note: The live search combobox still relies on the/wp/v2/searchendpoint which strips excerpts, so that specific dropdown remains a known Core limitation until #65022 is merged).getValueinsideindex.ts) alongside the visual render components (view.tsx). This ensures the snippet is applied to the underlying data model, making untitled posts correctly searchable and alphabetically sortable within DataViews tables.Testing Instructions
(no title) - [Your content snippet...].(Copy)and does not contain the snippet.Screenshots or screencast