Skip to content

Conversation

@pfefferle
Copy link
Member

Fixes #2566

Proposed changes:

  • 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 a single shared template
  • Add proper admin notices for success/failure/no selection cases
  • Add removable query args filter for one-time notices

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  1. Create a post and publish it
  2. Wait for it to be federated (check the ActivityPub Status column shows "Federated")
  3. Go to Posts > All Posts
  4. Select one or more federated posts using the checkboxes
  5. From the "Bulk actions" dropdown, select "Soft Delete" and click "Apply"
  6. Verify you see the confirmation page listing the selected posts
  7. Click "Delete from Fediverse" to confirm
  8. Verify you see a success notice and the posts' ActivityPub status changes to "Deleted"

Testing row action:

  1. On the Posts list, hover over a federated post
  2. Click "Soft Delete" in the row actions
  3. Confirm the deletion in the browser dialog
  4. Verify success notice appears

Testing non-federated posts:

  1. Select posts that haven't been federated yet
  2. Apply "Soft Delete" bulk action
  3. Verify you see a warning notice that no posts were federated

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch

Type

  • Added - for new features

Message

Add bulk and row action to soft delete posts from the Fediverse.

- 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
Copilot AI review requested due to automatic review settings January 29, 2026 16:24
@pfefferle pfefferle self-assigned this Jan 29, 2026
@pfefferle pfefferle requested a review from a team January 29, 2026 16:24
Copy link

Copilot AI left a 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.
Copy link

Copilot AI left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Manual option to send Delete activity to Fediverse

2 participants