Make WordPress Core

Changeset 44981


Ignore:
Timestamp:
03/22/2019 12:59:02 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Plugins: Remove wp_is_wp_compatible() and wp_is_php_compatible() functions added in [44978] for now, to discuss use cases and better naming.

See #46599, #43992.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r44979 r44981  
    10911091    }
    10921092
    1093     $plugin_data['wp_compatible']  = wp_is_wp_compatible( $plugin_data['requires'] );
    1094     $plugin_data['php_compatible'] = wp_is_php_compatible( $plugin_data['requires_php'] );
     1093    $plugin_data['wp_compatible']  = version_compare( get_bloginfo( 'version' ), $plugin_data['requires'], '>=' );
     1094    $plugin_data['php_compatible'] = version_compare( phpversion(), $plugin_data['requires_php'], '>=' );
    10951095
    10961096    $plugin_data = array_merge( $plugin_data, get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ) );
  • trunk/src/wp-includes/functions.php

    r44978 r44981  
    68986898    echo '</p>';
    68996899}
    6900 
    6901 /**
    6902  * Checks compatibility with the current WordPress version.
    6903  *
    6904  * @since 5.2.0
    6905  *
    6906  * @param string $required Minimum required WordPress version.
    6907  * @return bool True if required version is compatible or empty, false if not.
    6908  */
    6909 function wp_is_wp_compatible( $required ) {
    6910     $wp_version = get_bloginfo( 'version' );
    6911 
    6912     return empty( $required ) || version_compare( $wp_version, $required, '>=' );
    6913 }
    6914 
    6915 /**
    6916  * Checks compatibility with the current PHP version.
    6917  *
    6918  * @since 5.2.0
    6919  *
    6920  * @param string $required Minimum required PHP version.
    6921  * @return bool True if required version is compatible or empty, false if not.
    6922  */
    6923 function wp_is_php_compatible( $required ) {
    6924     return empty( $required ) || version_compare( phpversion(), $required, '>=' );
    6925 }
Note: See TracChangeset for help on using the changeset viewer.