mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-30 15:31:04 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@59192 git-svn-id: http://core.svn.wordpress.org/trunk@58587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8410b2fc26
commit
a13d535628
@ -8833,7 +8833,11 @@ function clean_dirsize_cache( $path ) {
|
|||||||
* @return string The current WordPress version.
|
* @return string The current WordPress version.
|
||||||
*/
|
*/
|
||||||
function wp_get_wp_version() {
|
function wp_get_wp_version() {
|
||||||
|
static $wp_version;
|
||||||
|
|
||||||
|
if ( ! isset( $wp_version ) ) {
|
||||||
require ABSPATH . WPINC . '/version.php';
|
require ABSPATH . WPINC . '/version.php';
|
||||||
|
}
|
||||||
|
|
||||||
return $wp_version;
|
return $wp_version;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.7-beta1-59191';
|
$wp_version = '6.7-beta1-59192';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user