-
Notifications
You must be signed in to change notification settings - Fork 83
Prevent post creation when Reader is deactivated #2666
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
Conversation
Add early return in create_post() to skip post creation when the Reader feature is disabled.
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 a check to prevent the creation of ap_post entries when the Reader feature is disabled. This addresses an issue where posts were being created even when the Reader UI was turned off.
Key Changes:
- Added early return in
Create::create_post()method to check theactivitypub_create_postsoption before creating posts - Added comprehensive test coverage for both enabled and disabled states
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
includes/handler/class-create.php |
Added option check at the start of create_post() to return false when activitypub_create_posts is not enabled |
tests/phpunit/tests/includes/handler/class-test-create.php |
Added two new test methods to verify post creation is properly blocked when the option is disabled and works when enabled |
.github/changelog/fix-disable-create-posts-option |
Added changelog entry documenting this bug fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Simplify maybe_prevent_comment_notification to prevent all comment email notifications for ap_post regardless of any settings.
This reverts commit a7c65ba.
Supersedes #2664
Proposed changes:
create_post()to skip post creation when the Reader feature is disabled.Other information:
Testing instructions:
ap_postposts be createdap_postis createdChangelog entry
Changelog Entry Details
Significance
Type
Message
Prevent post creation when Reader is deactivated.