Repository navigation
fix(comments): enforce Core parity for spam and trash row actions. - #931
Open
KarunyaChavan wants to merge 5 commits into
Open
KarunyaChavan wants to merge 5 commits into
KarunyaChavan wants to merge 5 commits into
Conversation
- Replace the universal "Approve" button with "Not Spam" in the Spam tab. - Replace "Approve" with "Restore" in the Trash tab. - Route both actions to their correct Core functions (`wp_unspam_comment` and `wp_untrash_comment`). - Prevent data loss: using "Approve" previously destroyed `_wp_trash_meta_status`, forcing pending comments to bypass moderation and become published. - Align behavior with Classic admin, which hides the Approve button in these views for this exact reason.
* Replace universal "Approve" with "Not Spam" (unspam) in the Spam tab. * Replace "Approve" with "Restore" (untrash) in the Trash tab. * Suppress Reply and Edit for spam/trash rows - replying under a quarantined parent is incoherent; editing offers no value before restoring. * Keep Trash visible on spam rows so the Recycle Bin remains the permanent-deletion path.
* Assert spam row renders [Not Spam, Trash] - no Approve, Reply or Edit. * Assert trash row renders [Restore, Spam] - no Approve, Reply, Edit or Trash. * Assert Not Spam dispatches unspam with no confirmation; Restore dispatches untrash with no confirmation.
KarunyaChavan
marked this pull request as ready for review
October 1, 2026 08:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the action button mismatch in the native Comments window by aligning the available actions for "spam" and "trash" comments with WordPress Core's
class-wp-comments-list-table.php.Closes #918
Why?
The original App Framework port of the comments window unintentionally omitted the status guards on row actions. This led to a few UX and logical bugs:
What Changed?
wp_unspam_comment).wp_untrash_comment).isQuarantinedflag (status === 'spam' || status === 'trash'). If true, the Reply and Edit buttons are hidden, mirroring Core's exact guard.spamandtrashstatuses.unspamanduntrashfire correctly without requiring confirmation dialogs.Steps for Testing