Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#30586 closed enhancement (fixed)

'not_found' taxonomy label should be used in the list table

Reported by: iammathews Owned by: wonderboymusic
Priority: normal Milestone: 4.2
Component: Taxonomy Version: 2.3
Severity: normal Keywords: has-patch 4.2-early
Cc: Focuses: administration

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)

30586.patch​ (2.0 KB ) - added by SergeyBiryukov 12 years ago.
tax-no-items.PNG​ (30.9 KB ) - added by iammathews 12 years ago.
Screenshot of issue.

Download all attachments as: .zip

Change History (9)

#1 @SergeyBiryukov
12 years ago

  • Focuses accessibility removed

There is a 'not_found' argument​ for taxonomy labels, see #23597 where it was introduced.

#2 @iammathews
12 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).

Last edited 12 years ago by iammathews (previous) (diff)

#3 @johnbillion
12 years ago

  • Keywords needs-patch added
  • Version 4.0.1 → 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 @SergeyBiryukov
12 years ago

  • Keywords has-patch added; needs-patch removed
  • Summary Taxonomy (register_taxonomy) → '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.

#5 @SergeyBiryukov
12 years ago

  • Keywords 4.2-early added
  • Milestone Awaiting Review → Future Release

@iammathews
12 years ago

Screenshot of issue.

#6 @wonderboymusic
12 years ago

  • Owner set to wonderboymusic
  • Resolution → fixed
  • Status new → closed

In 31035:

Use the 'not_found' label when there are no items for a taxonomy in the terms list table.

Props SergeyBiryukov.
Fixes #30586.

#7 @wonderboymusic
12 years ago

  • Milestone Future Release → 4.2
Note: See TracTickets for help on using tickets.