Plugins/Themes: Allow to install/activate plugins/themes which require the WordPress version currently in development.
Twenty Twenty-Two requires WordPress 5.9 but currently can't be (re)activated in the 5.9 branch because `version_compare( '5.9-RC3-52627', '5.9', '>=' )` as used by `is_wp_version_compatible()` returns `false`. To appreciate the testing of upcoming versions any `-alpha`, `-RC`, `-beta` suffixes are now stripped off from the WordPress version before checking for compatibility. Fixes #54882. Built from https://develop.svn.wordpress.org/trunk@52628 git-svn-id: http://core.svn.wordpress.org/trunk@52216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -8342,11 +8342,18 @@ function clean_dirsize_cache( $path ) {
|
||||
*
|
||||
* @since 5.2.0
|
||||
*
|
||||
* @global string $wp_version WordPress version.
|
||||
*
|
||||
* @param string $required Minimum required WordPress version.
|
||||
* @return bool True if required version is compatible or empty, false if not.
|
||||
*/
|
||||
function is_wp_version_compatible( $required ) {
|
||||
return empty( $required ) || version_compare( get_bloginfo( 'version' ), $required, '>=' );
|
||||
global $wp_version;
|
||||
|
||||
// Strip off any -alpha, -RC, -beta, -src suffixes.
|
||||
list( $version ) = explode( '-', $wp_version );
|
||||
|
||||
return empty( $required ) || version_compare( $version, $required, '>=' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user