#30586 closed enhancement (fixed)
'not_found' taxonomy label should be used in the list table
Reported by: | iammathews | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 2.3 |
Component: | Taxonomy | Keywords: | has-patch 4.2-early |
Focuses: | administration | Cc: |
Description
When registering a new taxonomy, you cannot change the "No items found." label when there are no items for that specific taxonomy.
Attachments (2)
Change History (9)
#2
@
10 years ago
As read on the codex - 'not_found' (3.6+) - the text displayed via clicking 'Choose from the most used tags' in the taxonomy meta box when no tags are available. This string is not used on hierarchical taxonomies.
It's as if 'not_found' gets ignored. Here's the code:
add_action( 'init', 'register_programme_types', 0 ); function register_programme_types(){ $labels = array( 'name' => _x( 'Programme Types', '' ), 'singular_name' => _x( 'Type', '' ), 'menu_name' => __( 'Programme Types' ), 'all_items' => __( 'All Types' ), 'edit_item' => __( 'Edit Type' ), 'view_item' => __( 'View Type' ), 'update_item' => __( 'Update Type' ), 'add_new_item' => __( 'Add New Type' ), 'new_item_name' => __( 'New Type Name' ), 'parent_item' => __( 'Parent Type' ), 'parent_item_colon' => __( 'Parent Type:' ), 'search_items' => __( 'Search Types' ), 'not_found' => __( 'No types found.' ), ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'types' ), ); register_taxonomy( 'types', array( 'programmes' ), $args ); }
*Attached the image I removed (tax-no-items.PNG).*
#3
@
10 years ago
- Keywords needs-patch added
- Version changed from 4.0.1 to 2.3
I've noticed this before. As iammathews points out, it's not used on non-hierarchical taxonomies. I started patching this once before and must have gotten distracted.
#4
@
10 years ago
- Keywords has-patch added; needs-patch removed
- Summary changed from Taxonomy (register_taxonomy) to 'not_found' taxonomy label should be used in the list table
Well, it's not used in the list table, regardless of whether the taxonomy is hierarchical.
30586.patch fixes that.
Note: See
TracTickets for help on using
tickets.
There is a 'not_found' argument for taxonomy labels, see #23597 where it was introduced.