diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 7f09a4f557..dd6baad382 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -655,7 +655,7 @@ function wp_ajax_get_tagcloud() { $tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) ); if ( empty( $tags ) ) - wp_die( isset( $tax->no_tagcloud ) ? $tax->no_tagcloud : __('No tags found!') ); + wp_die( $tax->labels->no_tagcloud ); if ( is_wp_error( $tags ) ) wp_die( $tags->get_error_message() ); diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index ed20bcefea..94b345d5cc 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -411,6 +411,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. + * - no_tagcloud - This string isn't used on hierarchical taxonomies. Default is "No tags found!", used in the meta box. * * Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories). * @@ -423,6 +424,9 @@ function get_taxonomy_labels( $tax ) { if ( isset( $tax->helps ) && empty( $tax->labels['separate_items_with_commas'] ) ) $tax->labels['separate_items_with_commas'] = $tax->helps; + if ( isset( $tax->no_tagcloud ) && empty( $tax->labels['no_tagcloud'] ) ) + $tax->labels['no_tagcloud'] = $tax->no_tagcloud; + $nohier_vs_hier_defaults = array( 'name' => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ), 'singular_name' => array( _x( 'Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ), @@ -439,6 +443,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 ), + 'no_tagcloud' => array( __( 'No tags found!' ), null ), ); $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];