Make WordPress Core

Changeset 59192


Ignore:
Timestamp:
10/07/2024 09:11:50 PM (3 months ago)
Author:
peterwilsoncc
Message:

General: Memoize the return value in wp_get_wp_version().

Cache the unmodified $wp_version value as a static. This retains the current behaviour during the upgrade process $wp_version referencing the version of WordPress being upgraded from.

Follow up to [58848].

Props Cybr, debarghyabanerjee, mukesh27, costdev, SergeyBiryukov, TobiasBg, desrosj, azaozz.
Fixes #61782.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r59120 r59192  
    88348834 */
    88358835function wp_get_wp_version() {
    8836     require ABSPATH . WPINC . '/version.php';
     8836    static $wp_version;
     8837
     8838    if ( ! isset( $wp_version ) ) {
     8839        require ABSPATH . WPINC . '/version.php';
     8840    }
    88378841
    88388842    return $wp_version;
Note: See TracChangeset for help on using the changeset viewer.