[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 09:03:03 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: | Focuses:
-------------------------+------------------------------
Comment (by huzaifaalmesbah):
If `wp_get_branch_version()` is introduced and returns `major.minor` (e.g.
`7.0`, `6.9`), we could keep the current `admin-header.php` behavior
(dropping the trailing `.0`) like this:
{{{
$admin_body_class .= ' branch-' . str_replace( '.', '-', preg_replace(
'/\.0$/', '', wp_get_branch_version() ) );
}}}
This removes the `(float)` cast while preserving the existing `branch-7`
behavior.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64830#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list