WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/12/2019 11:55:19 PM (3 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/update.php

    r45117 r45185  
    401401        }
    402402
    403         $compatible_php = ( empty( $response->requires_php ) || version_compare( phpversion(), $response->requires_php, '>=' ) );
     403        $requires_php   = isset( $response->requires_php ) ? $response->requires_php : null;
     404        $compatible_php = is_php_version_compatible( $requires_php );
    404405        $notice_type    = $compatible_php ? 'notice-warning' : 'notice-error';
    405406
Note: See TracChangeset for help on using the changeset viewer.