-
Notifications
You must be signed in to change notification settings - Fork 138
Add a simple php version check around a deprecated function. #2285
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
Add a simple php version check around a deprecated function. #2285
Conversation
…roy that does nothing in php version > 8.0
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @[email protected]. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #2285 +/- ##
==========================================
- Coverage 68.86% 68.85% -0.02%
==========================================
Files 90 90
Lines 7610 7612 +2
==========================================
Hits 5241 5241
- Misses 2369 2371 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
westonruter
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.
Looks good. But probably good to add a comment explaining why the phpcs:ignore comments are added, if not already obvious.
|
I just ran across how this is done in core: https://github.com/WordPress/wordpress-develop/blob/9306d1150397c9c1aa09660058488d0bc94eb2a6/src/wp-admin/includes/image-edit.php#L548-L550 if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0.
imagedestroy( $img );
} |
adamsilverstein
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.
Great!
Fixes : #2273