-
Notifications
You must be signed in to change notification settings - Fork 82
Update follow return types and error handling #2094
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
Changed the return type documentation for follow methods to only return WP_Post or WP_Error. Improved error handling in Following::follow by returning a WP_Error if adding to outbox fails.
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 updates the return type documentation for follow methods to be more accurate and improves error handling by returning a WP_Error when adding to outbox fails.
- Updated docstring return types from
int|false|\WP_Post|\WP_Error
to\WP_Post|\WP_Error
- Enhanced error handling in
Following::follow
to return aWP_Error
whenadd_to_outbox
fails
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
includes/functions.php | Updated docstring return type for the follow function |
includes/collection/class-following.php | Updated docstring return type and added error handling for failed outbox operations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Deleted the .github/changelog/2094-from-description file as it is no longer needed.
Introduces a call to add_to_outbox when creating a follow activity, ensuring it is added with private visibility. This helps manage the visibility of follow actions and improves activity tracking.
Changed the example command from 'self-destruct' to 'self_destruct' in the class-cli.php file to reflect the correct command syntax.
This reverts commit 38aa151.
Changed the return type documentation for follow methods to only return WP_Post or WP_Error. Improved error handling in Following::follow by returning a WP_Error if adding to outbox fails.
Fixes #2092
Proposed changes:
int|false|\WP_Post|\WP_Error
to\WP_Post|\WP_Error
Following::follow
to return aWP_Error
whenadd_to_outbox
failsOther information:
Testing instructions:
Changelog entry
Changelog Entry Details
Significance
Type
Message