Opened 16 years ago
Closed 16 years ago
#13805 closed defect (bug) (fixed)
Custom Taxonomy: Wrong Labels Wordpress 3
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.0 | Priority: | normal |
| Severity: | normal | Version: | 3.0 |
| Component: | Taxonomy | Keywords: | |
| Focuses: | Cc: |
Description (last modified by )
In Wordpress 3, when I specify a a custom non hierarchy taxonomy (like tags) the wrong labels are used. Works with with a hierarchy based one:
function bugpress_taxonomy() {
//taxonomies
$labels = array(
'name' => _x( 'Assigned to', 'taxonomy general name' ),
'singular_name' => _x( 'Assigned to', 'taxonomy singular name' ),
'search_items' => __( 'Search Assignees' ),
'popular_items' => __( 'Popular Assignees' ),
'all_items' => __( 'All Assignees' ),
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit Assignees' ),
'update_item' => __( 'Update Assignees' ),
'add_new_item' => __( 'Add New Assignee' ),
'new_item_name' => __( 'New Assignee Name' ),
);
register_taxonomy('assigned_to','ticket',array(
'hierarchical' => false,
'labels' => $labels,
'show_ui' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'assigned_to' ),
));
}
Attachments (1)
Change History (13)
#1
@
16 years ago
When
hierarchial is TRUE correct labels are used.
when FALSE wrong labels as screenshot shows
Just to clarify
#3
@
16 years ago
It looks like register_taxonomy and maybe register_posttype expect you to pass in the labels in an array in the safe format as it is in get_taxonomy_labels and get_post_type_labels.
So your labels need to be in an array and in the correct position to get used.
#5
@
16 years ago
It's a bug in your registration code.
You need this:
register_taxonomy('assigned_to','ticket',array(
'hierarchical' => false,
'labels' => $labels,
'show_ui' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'assigned_to' ),
'helps' => __('Separate assignees with commas.'),
'help_hint' => __('Add new assignee'),
'help_nojs' => __('Add or remove assignees'),
'help_cloud' => __('Choose from the most frequent assignees'),
));
#6
@
16 years ago
- Keywords reporter-feedback added; wordpress3 taxonomy labels removed
We could do with documenting the help* args in register_taxonomy that post_tags_meta_box uses.
Fancy creating a patch for that ;-)
#7
@
16 years ago
- Description modified (diff)
The help* args should have become labels for non-hierarchical taxonomies I think.
#9
@
16 years ago
I updated it to use add_new_item for the hint. The others should move to proper labels, as nacin noted. While I was in there I changed post_tags_meta_box() to accept a taxonomy arg like we do with the categories box.
#10
@
16 years ago
I'm using a custom UI (add_meta_box) anyway, but since I came across it and the fact that the helps is missing from the docs, thought I would report it :-)
#11
@
16 years ago
- Keywords reporter-feedback removed
- Owner set to nacin
- Status changed from new to accepted
Screenshot