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/includes/plugin.php

    r45116 r45185  
    11001100    }
    11011101
    1102     $plugin_data['wp_compatible']  = version_compare( get_bloginfo( 'version' ), $plugin_data['requires'], '>=' );
    1103     $plugin_data['php_compatible'] = version_compare( phpversion(), $plugin_data['requires_php'], '>=' );
     1102    $plugin_data['wp_compatible']  = is_wp_version_compatible( $plugin_data['requires'] );
     1103    $plugin_data['php_compatible'] = is_php_version_compatible( $plugin_data['requires_php'] );
    11041104
    11051105    $plugin_data = array_merge( $plugin_data, get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ) );
Note: See TracChangeset for help on using the changeset viewer.