Site Health: Verify PHP version requirements when auto-updating themes.

Follow up of [47819].
See #49653.
Fixes #50411.

git-svn-id: https://develop.svn.wordpress.org/trunk@48071 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2020-06-17 14:46:23 +00:00
parent 9c04110b46
commit 92456a8d4b

View File

@ -214,8 +214,8 @@ class WP_Automatic_Updater {
}
}
// If updating a plugin, ensure the minimum PHP version requirements are satisfied.
if ( 'plugin' === $type ) {
// If updating a plugin or theme, ensure the minimum PHP version requirements are satisfied.
if ( in_array( $type, array( 'plugin', 'theme' ), true ) ) {
if ( ! empty( $item->requires_php ) && version_compare( phpversion(), $item->requires_php, '<' ) ) {
return false;
}