Make WordPress Core


Ignore:
Timestamp:
04/12/2019 11:55:19 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Plugins: Introduce is_wp_version_compatible() and is_php_version_compatible() for checking compatibility with the current WordPress or PHP version.

Props afragen.
Fixes #46599.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/update-core.php

    r45184 r45185  
    296296        }
    297297
    298         $compatible_php = ( empty( $plugin_data->update->requires_php ) || version_compare( phpversion(), $plugin_data->update->requires_php, '>=' ) );
     298        $requires_php   = isset( $plugin_data->update->requires_php ) ? $plugin_data->update->requires_php : null;
     299        $compatible_php = is_php_version_compatible( $requires_php );
    299300
    300301        if ( ! $compatible_php && current_user_can( 'update_php' ) ) {
Note: See TracChangeset for help on using the changeset viewer.