Opened 14 years ago
Closed 14 years ago
#14832 closed enhancement (fixed)
Allow separate label for menu text when registering post type
Reported by: | husobj | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.0.1 |
Component: | Posts, Post Types | Keywords: | needs-patch |
Focuses: | Cc: |
Description
When registering a post type the labels array allows you to provide various titles to display.
If you register a new post type with a long-ish label, you may want to provide a shorter label for display in the admin menu so that it doesn't wrap onto 2 lines. The current labels array does not provide an option to do this.
Attachments (1)
Change History (16)
#3
@
14 years ago
- Milestone changed from Awaiting Review to 3.1
- Owner set to nacin
- Status changed from new to accepted
#4
@
14 years ago
I think we had discussed about something like that —name_short
or label_short
or something to that effect— in the 3.0 dev cycle, but it seems the idea somehow slipped among all the details of the implementation.
#7
@
14 years ago
- Keywords register_post_type removed
I'm not sure if this is how I want to do it. Feels like maybe we need a system to handle context and such, otherwise the labels array is going to keep growing as more requests and labels come in.
#8
@
14 years ago
Do you think 'short_label' would be better than 'menu_label' as per the comment above by demetris? That way it would make more sense if used in other scenarios.
Or perhaps filter labels based on context so you could change the label when used in the menu context - is that sort of what you're suggesting nacin?
#10
@
14 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
register_taxonomy('publisher', 'book', array('label' => 'Publisher'));
The Menu label remains "Post Tags".
#12
@
14 years ago
Would be easier to patch this into get_post_type_labels, but it'd be better in _get_custom_object_labels.
The attached patch adds a 'menu_label' to the labels array that can be used to provide a separate label for the admin menu. If you do not provide a menu_label, then it should default to just using the standard default label.