[wp-trac] [WordPress Trac] #35215: Setting help tab priorities fails to correctly order the tabs
WordPress Trac
noreply at wordpress.org
Thu Dec 24 04:10:35 UTC 2015
#35215: Setting help tab priorities fails to correctly order the tabs
----------------------------+-----------------------------
Reporter: meitar | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Help/About | Version: trunk
Severity: normal | Keywords:
Focuses: administration |
----------------------------+-----------------------------
When using the new `WP_Screen::add_help_tab()` feature of priorities, the
docs suggest these priorities should be numeric. However, they are not
correctly numerically sorted by priority. I had three help tabs with
priorities `2`, `10`, and `40` but `WP_Screen::get_help_tabs()` returned
them in the order `2`, `40`, `10`.
I traced this problem to the way `get_help_tabs()` was resorting the tabs
based on priority, which sorted the tabs by value rather than by their
priority keys.
Using `ksort()` instead of `sort()` fixes this issue for me. A patch is
attached.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35215>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list