Skip to content

Fix unlist button and add reasons to email#747

Open
MaggieCabrera wants to merge 2 commits into
WordPress:trunkfrom
MaggieCabrera:add-reasons-textarea
Open

Fix unlist button and add reasons to email#747
MaggieCabrera wants to merge 2 commits into
WordPress:trunkfrom
MaggieCabrera:add-reasons-textarea

Conversation

@MaggieCabrera

@MaggieCabrera MaggieCabrera commented Jun 4, 2026

Copy link
Copy Markdown

Summary

The Unlist button and its modal were not showing up on production. The editor plugin imports PluginPostStatusInfo and PluginDocumentSettingPanel from @wordpress/edit-post, but those were moved to @wordpress/editor in newer WordPress. On versions where the old location no longer provides them, the import is empty and the whole pattern editor plugin fails to render, so the button, the modal, and the Pattern Details panel all disappear at once. We now import from both packages and use whichever the running version provides, so it works on old and new WordPress.

While fixing this, we also made the modal's textarea actually useful to the author. Before, that field was saved as an internal note that only moderators could see, even though moderators often want to tell the author what is wrong so they can fix it and resubmit. Now the text is included in the unlisted email that goes to the author. We renamed the field to "Message to the pattern author" so it is clear the content will be sent to them.

How to test

  1. Open a pattern in the editor and confirm the Unlist button appears in the Status and visibility panel.
  2. Click Unlist, pick a reason, and write a message in the textarea.
  3. Submit and confirm the pattern is unlisted and the author receives an email containing both the reason and your message.
Screenshot 2026-06-04 at 15 43 54

This was working locally before my fix, and I don't know if I can reproduce the failure locally with the environment from this repo, so this fix is done a bit in the dark.

@MaggieCabrera MaggieCabrera marked this pull request as ready for review June 4, 2026 13:44
Combine the editor-package imports so there is a single import per
package (no-duplicate-imports) and let prettier format them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant