From 15e95388744c2ceb3a98a890516b9e4b80c02659 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 9 Jun 2010 21:59:13 +0000 Subject: [PATCH] Pass taxonomy to post_tags_meta_box. Use add_new_item label. see #13805 git-svn-id: http://svn.automattic.com/wordpress/trunk@15183 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-advanced.php | 2 +- wp-admin/includes/meta-boxes.php | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index e0fa28f19b..a31fd44837 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -117,7 +117,7 @@ foreach ( get_object_taxonomies($post_type) as $tax_name ) { $label = $taxonomy->labels->name; if ( !is_taxonomy_hierarchical($tax_name) ) - add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', $post_type, 'side', 'core'); + add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', $post_type, 'side', 'core', array( 'taxonomy' => $tax_name )); else add_meta_box($tax_name . 'div', $label, 'post_categories_meta_box', $post_type, 'side', 'core', array( 'taxonomy' => $tax_name )); } diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index 0d29552808..3eabf13d30 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -242,10 +242,16 @@ if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 * @param object $post */ function post_tags_meta_box($post, $box) { - $tax_name = esc_attr(substr($box['id'], 8)); - $taxonomy = get_taxonomy($tax_name); + $defaults = array('taxonomy' => 'post_tag'); + if ( !isset($box['args']) || !is_array($box['args']) ) + $args = array(); + else + $args = $box['args']; + extract( wp_parse_args($args, $defaults), EXTR_SKIP ); + $tax_name = esc_attr($taxonomy); + $taxonomy = get_taxonomy($taxonomy); + $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'); @@ -259,7 +265,7 @@ function post_tags_meta_box($post, $box) { cap->assign_terms) ) : ?>
-
+
labels->add_new_item; ?>