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.
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 );
} |
Fixes : #2273