[wp-trac] [WordPress Trac] #61627: Introduce helper function get the unmodified value of `$wp_version`.

WordPress Trac noreply at wordpress.org
Mon Oct 14 00:11:32 UTC 2024


#61627: Introduce helper function get the unmodified value of `$wp_version`.
-----------------------------------------------------+---------------------
 Reporter:  peterwilsoncc                            |       Owner:  (none)
     Type:  task (blessed)                           |      Status:  closed
 Priority:  normal                                   |   Milestone:  6.7
Component:  General                                  |     Version:
 Severity:  normal                                   |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests needs-dev-note  |     Focuses:
-----------------------------------------------------+---------------------
Changes (by peterwilsoncc):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 @fabiankaegy Thanks for the dev note reminder. I think this can go in the
 miscellanious developer improvements dev note rather than requiring a
 dedicated note.

 I'm happy for it to be edited but how about something along the lines of:

 > The function `wp_get_wp_version()` has been introduced to allow
 developers to get an unmodified version of the WordPress version.
 Previously WordPress used the `$wp_version` global which could be modified
 by themes and plugins causing unexpected side effects.
 >
 > WordPress uses the function in a number of locations in which a theme or
 plugin modifying the value could be problematic. This includes for version
 comparisons, during upgrade routines, in site health and debug reports.
 See #61627.

 Additionally, I've closed this as fixed as I can't see the need to further
 expand the use of the function. If anything is found to be broken, it can
 be fixed on a follow up ticket.

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


More information about the wp-trac mailing list