-
Notifications
You must be signed in to change notification settings - Fork 83
Add bulk soft delete action for posts #2840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
- Add bulk action "Soft Delete" to post list tables for all ActivityPub-enabled post types - Add row action "Soft Delete" for individual federated posts - Unify user and post soft delete confirmation templates into one - Add proper admin notices for success/failure/no selection cases - Add removable query args filter for one-time notices - Add comprehensive test coverage for Admin bulk delete functionality Fixes #2566
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds bulk and individual soft delete actions for federated posts, enabling users to remove posts from the Fediverse while keeping them on the WordPress site. The implementation unifies the confirmation template to handle both user and post deletions.
Changes:
- Added bulk action "Soft Delete" to post list tables for ActivityPub-enabled post types
- Added row action "Soft Delete" for individual federated posts with confirmation dialog
- Unified user and post soft delete confirmation into a single reusable template
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| includes/wp-admin/class-admin.php | Implements bulk and single post deletion handlers, registers bulk actions for ActivityPub-supported post types, adds admin notices and row actions for federated posts |
| templates/bulk-delete-confirmation.php | New unified template handling both user and post deletion confirmations with appropriate messaging and table layouts |
| templates/bulk-actor-delete-confirmation.php | Removed old user-specific template, replaced by unified template |
| tests/phpunit/tests/includes/wp-admin/class-test-admin.php | Comprehensive test coverage for bulk actions, row actions, permissions, and edge cases |
| .github/changelog/2840-from-description | Changelog entry documenting the new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add 13 new tests covering: - Non-existent post handling - Mixed federated/non-federated posts - Deleted and failed post states - Nonce and confirmation dialog in row actions - Complete removable query args verification - Page post type support - Empty post array handling - Draft post edge case - Title attribute verification
…late - Add 'checked' param (default: true) to control checkbox default state - Add 'cancel_label' param (default: 'Cancel') for the cancel button text - Use wp_parse_args for cleaner default handling - Pass checked=false and cancel_label='Skip' for user deletion flow to preserve original UX behavior
After successfully sending a Delete activity, set the post's activitypub_content_visibility to private. This prevents accidental re-federation while allowing users to manually re-federate by changing visibility back to public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #2566
Proposed changes:
Other information:
Testing instructions:
Testing row action:
Testing non-federated posts:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Add bulk and row action to soft delete posts from the Fediverse.