[wp-trac] [WordPress Trac] #64830: Introduce a helper function to extract the major.minor "branch" version

WordPress Trac noreply at wordpress.org
Mon Mar 9 23:47:50 UTC 2026


#64830: Introduce a helper function to extract the major.minor "branch" version
-------------------------+------------------------------
 Reporter:  apermo       |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  3.2
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------------------

Comment (by westonruter):

 Good idea to extend `wp_get_wp_version()` to get a subset of the version.

 Replying to [ticket:64830 apermo]:

 > Note: The existing `admin-header.php` behavior drops the .0 in the CSS
 class (producing branch-7 instead of branch-7-0). That's a quirk of the
 (float) cast. This is the main decision that needs to be taken which is
 the correct/expected behavior here.

 In 6.9.1, the added classes are `branch-6-9` and `version-6-9-1`. I'm not
 aware how these classes are used by plugins. But since they they were
 introduced in r17957 to fix #17496 in 3.2, I would think it's safe to
 assume that the intention was that the format would be `branch-X-Y`. That
 said, I see three plugins which currently have `.branch-7`, `.branch-6`,
 and `.branch-4`:
 https://veloria.dev/search/58a08df4-64a6-46a4-bd55-2db4705968c2 (news
 flash: the new WPdirectory!!)

 The `.branch-7` example comes from
 [https://wordpress.org/plugins/wpematico/ WPeMatico RSS Feed Fetcher]. It
 seems we should include both `branch-7` and `branch-7-0` for correctness
 and back-compat.

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


More information about the wp-trac mailing list