From 190165cb3236f615029253413cb3d08af203a7ae Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 3 Jan 2015 06:20:21 +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. Built from https://develop.svn.wordpress.org/trunk@31035 git-svn-id: http://core.svn.wordpress.org/trunk@31016 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-terms-list-table.php | 4 ++++ wp-includes/taxonomy.php | 4 ++-- wp-includes/version.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-terms-list-table.php b/wp-admin/includes/class-wp-terms-list-table.php index 1916b5ac03..b710c5f630 100644 --- a/wp-admin/includes/class-wp-terms-list-table.php +++ b/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/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 1e3e2a6565..f333a1e319 100644 --- a/wp-includes/taxonomy.php +++ b/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']; diff --git a/wp-includes/version.php b/wp-includes/version.php index 8ef87bc43c..1c4bb896c8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31034'; +$wp_version = '4.2-alpha-31035'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.