Make WordPress Core


Ignore:
Timestamp:
10/03/2024 12:23:53 AM (17 months ago)
Author:
peterwilsoncc
Message:

General: Expand use of wp_get_wp_version().

Expands the use of wp_get_wp_version() to get an unmodified value of the current WordPress version in various locations in which it would be unhelpful if a plugin has modified the global $wp_version.

This includes:

  • Theme and plugin compatibility tests
  • During the upgrade process of WP Core
  • Debug and site health data reports of the current version
  • Version number display in the dashboard
  • Block theme export and caching utilities
  • The WPDB class

Props peterwilsoncc, hellofromtonya.
See #61627.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/update-core.php

    r59064 r59159  
    3838    static $first_pass = true;
    3939
    40     $wp_version     = get_bloginfo( 'version' );
     40    $wp_version     = wp_get_wp_version();
    4141    $version_string = sprintf( '%s–%s', $update->current, get_locale() );
    4242
     
    394394
    395395    if ( $upgrade_major ) {
    396         $wp_version = get_bloginfo( 'version' );
     396        $wp_version = wp_get_wp_version();
    397397        $updates    = get_core_updates();
    398398
     
    461461 */
    462462function list_plugin_updates() {
    463     $wp_version     = get_bloginfo( 'version' );
     463    $wp_version     = wp_get_wp_version();
    464464    $cur_wp_version = preg_replace( '/-.*$/', '', $wp_version );
    465465
     
    11021102    echo '<h2 class="wp-current-version">';
    11031103    /* translators: Current version of WordPress. */
    1104     printf( __( 'Current version: %s' ), get_bloginfo( 'version' ) );
     1104    printf( __( 'Current version: %s' ), esc_html( wp_get_wp_version() ) );
    11051105    echo '</h2>';
    11061106
Note: See TracChangeset for help on using the changeset viewer.