Make WordPress Core


Ignore:
Timestamp:
01/24/2022 10:39:50 AM (3 years ago)
Author:
ocean90
Message:

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.

File:
1 edited

Legend:

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

    r52609 r52628  
    83438343 * @since 5.2.0
    83448344 *
     8345 * @global string $wp_version WordPress version.
     8346 *
    83458347 * @param string $required Minimum required WordPress version.
    83468348 * @return bool True if required version is compatible or empty, false if not.
    83478349 */
    83488350function is_wp_version_compatible( $required ) {
    8349     return empty( $required ) || version_compare( get_bloginfo( 'version' ), $required, '>=' );
     8351    global $wp_version;
     8352
     8353    // Strip off any -alpha, -RC, -beta, -src suffixes.
     8354    list( $version ) = explode( '-', $wp_version );
     8355
     8356    return empty( $required ) || version_compare( $version, $required, '>=' );
    83508357}
    83518358
Note: See TracChangeset for help on using the changeset viewer.