From 0a12ad2890ec258febb4b65e3840e94008a99cbe Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Sun, 4 Aug 2024 22:07:06 +0000 Subject: [PATCH] General: Removing static from `wp_get_wp_version()`. Removes the static storing the version number in `wp_get_wp_version()` to ensure the version number is reported correctly after a WordPress upgrade is completed. Reverts [58827]. Props costdev, SergeyBiryukov, Cybr. See #61782. git-svn-id: https://develop.svn.wordpress.org/trunk@58848 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 465383b81e..c433c7097f 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -8819,11 +8819,7 @@ function clean_dirsize_cache( $path ) { * @return string The current WordPress 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; }