Move 'no_tagcloud' argument to the taxonomy labels object. props DrewAPicture for initial patch. fixes #23597.

git-svn-id: http://core.svn.wordpress.org/trunk@23483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2013-02-25 18:35:05 +00:00
parent f8ecd2719c
commit bf1ca6b9ca
2 changed files with 6 additions and 1 deletions

View File

@ -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() );

View File

@ -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'];