Subscriptions: Prevent warning when $post global is malformed#48074
Subscriptions: Prevent warning when $post global is malformed#48074
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
anomiex
left a comment
There was a problem hiding this comment.
Seems reasonable to me. I don't know if there's a more reliable way to get the post than the $post global.
Code Coverage SummaryCoverage changed in 1 file.
|
Proposed changes
We're getting some of these:
Because
$postis a global, third-party code can and does sometimes modify it. This PR ensures it's aWP_Postbefore trying to use it.Related product discussion/links
Does this pull request change what data or activity we track or use?
Testing instructions
Looking at the code is probably the easiest option.