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/class-wp-plugins-list-table.php

    r45021 r45185  
    762762        }
    763763
    764         $compatible_php = ( empty( $plugin_data['requires_php'] ) || version_compare( phpversion(), $plugin_data['requires_php'], '>=' ) );
     764        $requires_php   = isset( $plugin['requires_php'] ) ? $plugin['requires_php'] : null;
     765        $compatible_php = is_php_version_compatible( $requires_php );
    765766        $class          = $is_active ? 'active' : 'inactive';
    766767        $checkbox_id    = 'checkbox_' . md5( $plugin_data['Name'] );
Note: See TracChangeset for help on using the changeset viewer.