Opened 13 years ago
Closed 13 years ago
#21094 closed defect (bug) (invalid)
Remove unnecessary 'menu_name' fallback in get_post_type_labels()
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | Cc: |
Description
get_post_type_labels()
sets the fallback for the menu_name
label to the name
label. Then it calls _get_custom_object_labels()
, which does the same thing along with a bunch of similar fallbacks.
This is an artifact of #14832, which lead to r16251, then to r16268, which made the fallback in get_post_type_labels()
unnecessary.
We can just remove the statement from get_post_type_labels()
and nothing will change (except WordPress will be just a bit simpler).
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
The line isn't unnecessary. If
$object->labels['name']
isn't set at that point then there will be no fallback. For example:Now there will be a notice during menu generation and the menu item will have no label.
Maybe it's unlikely to occur, but this fallback code does do something.