-
Notifications
You must be signed in to change notification settings - Fork 846
SAL: use Post ID instead of Post Object in current_user_can #13166
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
current_user_can only accepts object IDs as the optional second param; passing anything else (like an instance of Jetpack_Post like we did) will cause issues.
|
Caution: This PR has changes that must be merged to WordPress.com |
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: August 6, 2019. |
|
@jeherve Thank you for the PR! |
tyxla
left a comment
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.
LGTM 🚢
zinigor
left a comment
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.
I have been able to reproduce this problem using the plugin code from GitHub and a request to the v1.1 post update endpoint to the privacy page via WordPress.com REST API. LGTM!
…r_can (#13166) current_user_can only accepts object IDs as the optional second param; passing anything else (like an instance of Jetpack_Post like we did) will cause issues.
|
Cherry-picked to |
Changes proposed in this Pull Request:
current_user_canonly accepts object IDs as the optional second param; passing anything else (like an instance ofJetpack_Postlike we did) will cause issues.This was reported in 2184839-zen by a site owner using Polylang Pro.
Testing instructions:
I could not reproduce the Fatal myself, but something like this may help:
Proposed changelog entry for your changes: