From de7eec68d53eadb7d720bb77e1b307d61985aff5 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 1 Mar 2010 21:04:37 +0000 Subject: [PATCH] Add some custom taxonomy flags to allow fully customize strings in the taxonomy meta box. see #11838 git-svn-id: https://develop.svn.wordpress.org/trunk@13538 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-ajax.php | 6 ++++-- wp-admin/includes/meta-boxes.php | 11 +++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 29511c047a..7a960c98d3 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -620,8 +620,10 @@ case 'get-tagcloud' : $tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) ); - if ( empty( $tags ) ) - die( __('No tags found!') ); + if ( empty( $tags ) ) { + $tax = get_taxonomy( $taxonomy ); + die( isset( $tax->no_tagcloud ) ? $tax->no_tagcloud : __('No tags found!') ); + } if ( is_wp_error($tags) ) die($tags->get_error_message()); diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index 3a5744a9b1..9ad1dafed7 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -249,24 +249,27 @@ function post_tags_meta_box($post, $box) { $taxonomy = get_taxonomy($tax_name); if ( !current_user_can($taxonomy->assign_cap) ) // @todo: Display the terms, do not edit. return; - $helps = isset($taxonomy->helps) ? esc_attr($taxonomy->helps) : __('Separate tags with commas.'); + $helps = isset( $taxonomy->helps ) ? esc_attr( $taxonomy->helps ) : esc_attr__('Separate tags with commas.'); + $help_hint = isset( $taxonomy->help_hint ) ? $taxonomy->help_hint : __('Add new tag'); + $help_nojs = isset( $taxonomy->help_nojs ) ? $taxonomy->help_nojs : __('Add or remove tags'); + $help_cloud = isset( $taxonomy->help_cloud ) ? $taxonomy->help_cloud : __('Choose from the most used tags in %s'); ?>
-

+

-
+

-

+