mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-10 10:27:57 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@44981 git-svn-id: http://core.svn.wordpress.org/trunk@44812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
79e9aa9ed6
commit
50bb3c689f
@ -1090,8 +1090,8 @@ function validate_plugin_requirements( $plugin ) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$plugin_data['wp_compatible'] = wp_is_wp_compatible( $plugin_data['requires'] );
|
$plugin_data['wp_compatible'] = version_compare( get_bloginfo( 'version' ), $plugin_data['requires'], '>=' );
|
||||||
$plugin_data['php_compatible'] = wp_is_php_compatible( $plugin_data['requires_php'] );
|
$plugin_data['php_compatible'] = version_compare( phpversion(), $plugin_data['requires_php'], '>=' );
|
||||||
|
|
||||||
$plugin_data = array_merge( $plugin_data, get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ) );
|
$plugin_data = array_merge( $plugin_data, get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ) );
|
||||||
|
|
||||||
|
@ -6897,29 +6897,3 @@ function wp_direct_php_update_button() {
|
|||||||
);
|
);
|
||||||
echo '</p>';
|
echo '</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks compatibility with the current WordPress version.
|
|
||||||
*
|
|
||||||
* @since 5.2.0
|
|
||||||
*
|
|
||||||
* @param string $required Minimum required WordPress version.
|
|
||||||
* @return bool True if required version is compatible or empty, false if not.
|
|
||||||
*/
|
|
||||||
function wp_is_wp_compatible( $required ) {
|
|
||||||
$wp_version = get_bloginfo( 'version' );
|
|
||||||
|
|
||||||
return empty( $required ) || version_compare( $wp_version, $required, '>=' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks compatibility with the current PHP version.
|
|
||||||
*
|
|
||||||
* @since 5.2.0
|
|
||||||
*
|
|
||||||
* @param string $required Minimum required PHP version.
|
|
||||||
* @return bool True if required version is compatible or empty, false if not.
|
|
||||||
*/
|
|
||||||
function wp_is_php_compatible( $required ) {
|
|
||||||
return empty( $required ) || version_compare( phpversion(), $required, '>=' );
|
|
||||||
}
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.2-alpha-44980';
|
$wp_version = '5.2-alpha-44981';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user