From ca8fe1a7a41295c9f153706fd08f0fa63cf0afec Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 3 Jan 2015 06:19:46 +0000 Subject: [PATCH] Use the `'not_found'` label when there are no items for a taxonomy in the terms list table. Props SergeyBiryukov. Fixes #30586. git-svn-id: https://develop.svn.wordpress.org/trunk@31035 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-terms-list-table.php | 4 ++++ src/wp-includes/taxonomy.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/class-wp-terms-list-table.php b/src/wp-admin/includes/class-wp-terms-list-table.php index 1916b5ac03..b710c5f630 100644 --- a/src/wp-admin/includes/class-wp-terms-list-table.php +++ b/src/wp-admin/includes/class-wp-terms-list-table.php @@ -112,6 +112,10 @@ class WP_Terms_List_Table extends WP_List_Table { return true; } + public function no_items() { + echo get_taxonomy( $this->screen->taxonomy )->labels->not_found; + } + protected function get_bulk_actions() { $actions = array(); $actions['delete'] = __( 'Delete' ); diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 1e3e2a6565..f333a1e319 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -450,7 +450,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { * - separate_items_with_commas - This string isn't used on hierarchical taxonomies. Default is "Separate tags with commas", used in the meta box. * - add_or_remove_items - This string isn't used on hierarchical taxonomies. Default is "Add or remove tags", used in the meta box when JavaScript is disabled. * - choose_from_most_used - This string isn't used on hierarchical taxonomies. Default is "Choose from the most used tags", used in the meta box. - * - not_found - This string isn't used on hierarchical taxonomies. Default is "No tags found", used in the meta box. + * - not_found - Default is "No tags found"/"No categories found", used in the meta box and taxonomy list table. * * Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories). * @@ -484,7 +484,7 @@ function get_taxonomy_labels( $tax ) { 'separate_items_with_commas' => array( __( 'Separate tags with commas' ), null ), 'add_or_remove_items' => array( __( 'Add or remove tags' ), null ), 'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ), - 'not_found' => array( __( 'No tags found.' ), null ), + 'not_found' => array( __( 'No tags found.' ), __( 'No categories found.' ) ), ); $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];