[wp-trac] [WordPress Trac] #61782: Memoize wp_get_wp_version

WordPress Trac noreply at wordpress.org
Thu Oct 3 19:40:06 UTC 2024


#61782: Memoize wp_get_wp_version
------------------------------------------+-----------------------------
 Reporter:  Cybr                          |       Owner:  SergeyBiryukov
     Type:  defect (bug)                  |      Status:  reopened
 Priority:  normal                        |   Milestone:
Component:  General                       |     Version:  trunk
 Severity:  normal                        |  Resolution:
 Keywords:  has-patch dev-feedback close  |     Focuses:
------------------------------------------+-----------------------------
Changes (by azaozz):

 * status:  closed => reopened
 * resolution:  maybelater =>


Comment:

 Replying to [comment:7 costdev]:
 Having some second thoughts about [58848].

 > However, the return value of `wp_get_wp_version()` won't match the
 actual current version until the next request. This may need some further
 thought and testing.

 Right, but that is the old behavior? I mean, once the global `$wp_version`
 was set it is kept in memory and would not change even if the
 `version.php` file is updated and the version string there changes?

 It seems that catching the version as it exists at the time of first run
 of `wp_get_wp_version()` would match the old behavior better? Not
 completely sure if that can be changed without causing any
 inconsistencies. Then the functions that require the version as it appears
 after updating `version.php` would still have to `require` it locally.

 Reopening this just for visibility.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61782#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list