WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/31/2016 05:48:49 AM (3 years ago)
Author:
wonderboymusic
Message:

General: use get_bloginfo( 'version' ) instead of global $wp_version in several locations - excluding those locations which reload version.php mid-flight.

See #37699.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php

    r38307 r38459  
    7070     * @global string $type
    7171     * @global string $term
    72      * @global string $wp_version
    7372     */
    7473    public function prepare_items() {
     
    8988            $tabs['search'] = __( 'Search Results' );
    9089        }
    91         if ( $tab === 'beta' || false !== strpos( $GLOBALS['wp_version'], '-' ) ) {
     90        if ( $tab === 'beta' || false !== strpos( get_bloginfo( 'version' ), '-' ) ) {
    9291            $tabs['beta'] = _x( 'Beta Testing', 'Plugin Installer' );
    9392        }
     
    392391    }
    393392
    394     /**
    395      * @global string $wp_version
    396      */
    397393    public function display_rows() {
    398394        $plugins_allowedtags = array(
     
    575571                <div class="column-compatibility">
    576572                    <?php
    577                     if ( ! empty( $plugin['tested'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $plugin['tested'] ) ), $plugin['tested'], '>' ) ) {
     573                    $wp_version = get_bloginfo( 'version' );
     574
     575                    if ( ! empty( $plugin['tested'] ) && version_compare( substr( $wp_version, 0, strlen( $plugin['tested'] ) ), $plugin['tested'], '>' ) ) {
    578576                        echo '<span class="compatibility-untested">' . __( 'Untested with your version of WordPress' ) . '</span>';
    579                     } elseif ( ! empty( $plugin['requires'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $plugin['requires'] ) ), $plugin['requires'], '<' ) ) {
     577                    } elseif ( ! empty( $plugin['requires'] ) && version_compare( substr( $wp_version, 0, strlen( $plugin['requires'] ) ), $plugin['requires'], '<' ) ) {
    580578                        echo '<span class="compatibility-incompatible">' . __( '<strong>Incompatible</strong> with your version of WordPress' ) . '</span>';
    581579                    } else {
Note: See TracChangeset for help on using the changeset viewer.