Making WordPress.org


Ignore:
Timestamp:
01/20/2019 11:07:15 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Plugin Directory: Introduce Template::is_plugin_outdated() to check if the plugin was tested with the latest 3 major releases of WordPress.

See #4088.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php

    r8114 r8115  
    351351
    352352/**
    353  * Get current major WP version to check against "Tested up to" value.
    354  *
    355  * @global string $wp_version WordPress version.
    356  *
    357  * @return float Current major WP version.
    358  */
    359 function get_current_major_wp_version() {
    360     $current_version = '';
    361 
    362     // Assume the value stored in a constant (which is set on WP.org), if defined.
    363     if ( defined( 'WP_CORE_LATEST_RELEASE' ) && WP_CORE_LATEST_RELEASE ) {
    364         $current_version = substr( WP_CORE_LATEST_RELEASE, 0, 3 );
    365     }
    366 
    367     // Otherwise, use the version of the running WP instance.
    368     if ( empty( $current_version ) ) {
    369         global $wp_version;
    370 
    371         $current_version = substr( $wp_version, 0, 3 );
    372 
    373         // However, if the running WP instance appears to not be a release version, assume the latest stable version.
    374         if ( false !== strpos( $wp_version, '-' ) ) {
    375             $current_version = (float) $current_version - 0.1;
    376         }
    377     }
    378 
    379     return (float) $current_version;
    380 }
    381 
    382 /**
    383353 * Custom template tags for this theme.
    384354 */
Note: See TracChangeset for help on using the changeset viewer.