Repository navigation
Editor: Show the actions of the single context in the post actions menu - #85184
jorgefilipecosta wants to merge 1 commit into
Conversation
PostActions called usePostActions() without a context, so actions registered with `context: 'single'` showed on no screen. Request the `single` context, update the outdated filter comment, and add tests.
🤖 PR meta 🤖🎉 PropsIf 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. Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: -363 B (0%) Total Size: 8.97 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Regression: updating a specific option will only change its value and will not corrupt others in
|
What?
Follow up to #84660.
context: 'single'now show in the editor's actions menu (the post card panel in the document sidebar), and only there.Why?
PostActionscalledusePostActions()without acontext, and its filter drops every action that has one. So an action withcontext: 'single'showed on no screen, whilecontext: 'list'correctly showed only in the DataViews lists. The server registry acceptssingleas a supported value, so a plugin could register an editor-only action that never appears. Found while testing the server actions API on #83537 (comment).How?
PostActionsasks for the actions of thesinglecontext.usePostActions, which saidlistwas the only supported context.usePostActions, and checks thatPostActionsrequests thesinglecontext.Testing
wp-content/plugins/demo-page-action/and activate it.In
demo-page-action.php, add'context' => 'single'to thedemo-page-detailsaction ("Page details…").context: 'single') and "Show ID" doesn't (it'scontext: 'list'). On trunk, "Page details…" is missing.AI assistance: code, tests, and this description drafted with AI assistance and reviewed by me.