Make WordPress Core


Ignore:
Timestamp:
10/03/2024 12:23:53 AM (6 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/includes/update-core.php

    r59150 r59159  
    15401540 * @global array              $_old_requests_files Requests files to be preloaded.
    15411541 * @global WP_Filesystem_Base $wp_filesystem       WordPress filesystem subclass.
    1542  * @global string             $wp_version          The WordPress version string.
    15431542 *
    15441543 * @param string $to Path to old WordPress installation.
    15451544 */
    15461545function _preload_old_requests_classes_and_interfaces( $to ) {
    1547     global $_old_requests_files, $wp_filesystem, $wp_version;
     1546    global $_old_requests_files, $wp_filesystem;
     1547    $wp_version = wp_get_wp_version();
    15481548
    15491549    /*
     
    15881588 * @since 3.3.0
    15891589 *
    1590  * @global string $wp_version The WordPress version string.
    1591  * @global string $pagenow    The filename of the current screen.
     1590 * @global string $pagenow The filename of the current screen.
    15921591 * @global string $action
    15931592 *
     
    15951594 */
    15961595function _redirect_to_about_wordpress( $new_version ) {
    1597     global $wp_version, $pagenow, $action;
     1596    global $pagenow, $action;
     1597    $wp_version = wp_get_wp_version();
    15981598
    15991599    if ( version_compare( $wp_version, '3.4-RC1', '>=' ) ) {
Note: See TracChangeset for help on using the changeset viewer.