[wp-trac] [WordPress Trac] #16856: When registering custom post type, menu_position isn't honored if it's a number passed as a string
WordPress Trac
wp-trac at lists.automattic.com
Mon Mar 14 18:50:51 UTC 2011
#16856: When registering custom post type, menu_position isn't honored if it's a
number passed as a string
-------------------------------------+--------------------
Reporter: nathanrice | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.1.1
Component: Administration | Version: 3.1
Severity: normal | Resolution:
Keywords: has-patch needs-testing |
-------------------------------------+--------------------
Comment (by nathanrice):
@scribu
Thanks!
The current menu position paradigm is weak, IMO, and I think other devs
agree. Giving 15 positions between Comments and Appearance for CPTs and
custom menus means there is bound to be a conflict at some point. The 15
position limit itself isn't the weakness, it's the fact that there's a
limit at all.
Ideally, menu_position would accept a section as a parameter. Main,
Content, Settings, for example. And you could register a new section too,
if you wanted, that could go at the bottom, or between two other sections.
{{{
register_menu_section( 'my-section', array( 'main', 'content' ) );
}}}
You get the idea. Register 'my-section' between 'main' and 'content',
adding the menu separaters automatically.
Then, top level menus (custom menus, CPTs, etc.) get added to a section
(default or custom) based on the order they're registered. Let themers and
plugin writers fight over who's menu gets added first/last, but at least
they all show up.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16856#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list