Skip to content

Commit

Permalink
General: Removing static from wp_get_wp_version().
Browse files Browse the repository at this point in the history
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
  • Loading branch information
peterwilsoncc committed Aug 4, 2024
1 parent 54e2272 commit 0a12ad2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0a12ad2

Please sign in to comment.