post_tags_meta_box

The timeline below displays how wordpress function post_tags_meta_box has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Displays post tags form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Current post object.
 * @param array   $box {
 *     Tags meta box arguments.
 *
 *     @type string   $id       Meta box 'id' attribute.
 *     @type string   $title    Meta box title.
 *     @type callable $callback Meta box display callback.
 *     @type array    $args {
 *         Extra meta box arguments.
 *
 *         @type string $taxonomy Taxonomy. Default 'post_tag'.
 *     }
 * }
 */
function post_tags_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'post_tag');
    if (!isset($box['args']) || !is_array($box['args'])) {
        $args = array();
    } else {
        $args = $box['args'];
    }
    $parsed_args = wp_parse_args($args, $defaults);
    $tax_name = esc_attr($parsed_args['taxonomy']);
    $taxonomy = get_taxonomy($parsed_args['taxonomy']);
    $user_can_assign_terms = current_user_can($taxonomy->cap->assign_terms);
    $comma = _x(',', 'tag delimiter');
    $terms_to_edit = get_terms_to_edit($post->ID, $tax_name);
    if (!is_string($terms_to_edit)) {
        $terms_to_edit = '';
    }
    ?>
<div class="tagsdiv" id="<?php 
    echo $tax_name;
    ?>">
	<div class="jaxtag">
	<div class="nojs-tags hide-if-js">
		<label for="tax-input-<?php 
    echo $tax_name;
    ?>"><?php 
    echo $taxonomy->labels->add_or_remove_items;
    ?></label>
		<p><textarea name="<?php 
    echo "tax_input[{$tax_name}]";
    ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php 
    echo $tax_name;
    ?>" <?php 
    disabled(!$user_can_assign_terms);
    ?> aria-describedby="new-tag-<?php 
    echo $tax_name;
    ?>-desc"><?php 
    echo str_replace(',', $comma . ' ', $terms_to_edit);
    // textarea_escaped by esc_attr() 
    ?></textarea></p>
	</div>
	<?php 
    if ($user_can_assign_terms) {
        ?>
	<div class="ajaxtag hide-if-no-js">
		<label class="screen-reader-text" for="new-tag-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
		<input data-wp-taxonomy="<?php 
        echo $tax_name;
        ?>" type="text" id="new-tag-<?php 
        echo $tax_name;
        ?>" name="newtag[<?php 
        echo $tax_name;
        ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php 
        echo $tax_name;
        ?>-desc" value="" />
		<input type="button" class="button tagadd" value="<?php 
        esc_attr_e('Add');
        ?>" />
	</div>
	<p class="howto" id="new-tag-<?php 
        echo $tax_name;
        ?>-desc"><?php 
        echo $taxonomy->labels->separate_items_with_commas;
        ?></p>
	<?php 
    } elseif (empty($terms_to_edit)) {
        ?>
		<p><?php 
        echo $taxonomy->labels->no_terms;
        ?></p>
	<?php 
    }
    ?>
	</div>
	<ul class="tagchecklist" role="list"></ul>
</div>
	<?php 
    if ($user_can_assign_terms) {
        ?>
<p class="hide-if-no-js"><button type="button" class="button-link tagcloud-link" id="link-<?php 
        echo $tax_name;
        ?>" aria-expanded="false"><?php 
        echo $taxonomy->labels->choose_from_most_used;
        ?></button></p>
<?php 
    }
    ?>
	<?php 
}

WordPress Version: 5.3

/**
 * Display post tags form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Tags meta box arguments.
 *
 *     @type string   $id       Meta box 'id' attribute.
 *     @type string   $title    Meta box title.
 *     @type callable $callback Meta box display callback.
 *     @type array    $args {
 *         Extra meta box arguments.
 *
 *         @type string $taxonomy Taxonomy. Default 'post_tag'.
 *     }
 * }
 */
function post_tags_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'post_tag');
    if (!isset($box['args']) || !is_array($box['args'])) {
        $args = array();
    } else {
        $args = $box['args'];
    }
    $parsed_args = wp_parse_args($args, $defaults);
    $tax_name = esc_attr($parsed_args['taxonomy']);
    $taxonomy = get_taxonomy($parsed_args['taxonomy']);
    $user_can_assign_terms = current_user_can($taxonomy->cap->assign_terms);
    $comma = _x(',', 'tag delimiter');
    $terms_to_edit = get_terms_to_edit($post->ID, $tax_name);
    if (!is_string($terms_to_edit)) {
        $terms_to_edit = '';
    }
    ?>
<div class="tagsdiv" id="<?php 
    echo $tax_name;
    ?>">
	<div class="jaxtag">
	<div class="nojs-tags hide-if-js">
		<label for="tax-input-<?php 
    echo $tax_name;
    ?>"><?php 
    echo $taxonomy->labels->add_or_remove_items;
    ?></label>
		<p><textarea name="<?php 
    echo "tax_input[{$tax_name}]";
    ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php 
    echo $tax_name;
    ?>" <?php 
    disabled(!$user_can_assign_terms);
    ?> aria-describedby="new-tag-<?php 
    echo $tax_name;
    ?>-desc"><?php 
    echo str_replace(',', $comma . ' ', $terms_to_edit);
    // textarea_escaped by esc_attr() 
    ?></textarea></p>
	</div>
	<?php 
    if ($user_can_assign_terms) {
        ?>
	<div class="ajaxtag hide-if-no-js">
		<label class="screen-reader-text" for="new-tag-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
		<input data-wp-taxonomy="<?php 
        echo $tax_name;
        ?>" type="text" id="new-tag-<?php 
        echo $tax_name;
        ?>" name="newtag[<?php 
        echo $tax_name;
        ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php 
        echo $tax_name;
        ?>-desc" value="" />
		<input type="button" class="button tagadd" value="<?php 
        esc_attr_e('Add');
        ?>" />
	</div>
	<p class="howto" id="new-tag-<?php 
        echo $tax_name;
        ?>-desc"><?php 
        echo $taxonomy->labels->separate_items_with_commas;
        ?></p>
	<?php 
    } elseif (empty($terms_to_edit)) {
        ?>
		<p><?php 
        echo $taxonomy->labels->no_terms;
        ?></p>
	<?php 
    }
    ?>
	</div>
	<ul class="tagchecklist" role="list"></ul>
</div>
	<?php 
    if ($user_can_assign_terms) {
        ?>
<p class="hide-if-no-js"><button type="button" class="button-link tagcloud-link" id="link-<?php 
        echo $tax_name;
        ?>" aria-expanded="false"><?php 
        echo $taxonomy->labels->choose_from_most_used;
        ?></button></p>
<?php 
    }
    ?>
	<?php 
}

WordPress Version: 5.1

/**
 * Display post tags form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Tags meta box arguments.
 *
 *     @type string   $id       Meta box 'id' attribute.
 *     @type string   $title    Meta box title.
 *     @type callable $callback Meta box display callback.
 *     @type array    $args {
 *         Extra meta box arguments.
 *
 *         @type string $taxonomy Taxonomy. Default 'post_tag'.
 *     }
 * }
 */
function post_tags_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'post_tag');
    if (!isset($box['args']) || !is_array($box['args'])) {
        $args = array();
    } else {
        $args = $box['args'];
    }
    $r = wp_parse_args($args, $defaults);
    $tax_name = esc_attr($r['taxonomy']);
    $taxonomy = get_taxonomy($r['taxonomy']);
    $user_can_assign_terms = current_user_can($taxonomy->cap->assign_terms);
    $comma = _x(',', 'tag delimiter');
    $terms_to_edit = get_terms_to_edit($post->ID, $tax_name);
    if (!is_string($terms_to_edit)) {
        $terms_to_edit = '';
    }
    ?>
<div class="tagsdiv" id="<?php 
    echo $tax_name;
    ?>">
	<div class="jaxtag">
	<div class="nojs-tags hide-if-js">
		<label for="tax-input-<?php 
    echo $tax_name;
    ?>"><?php 
    echo $taxonomy->labels->add_or_remove_items;
    ?></label>
		<p><textarea name="<?php 
    echo "tax_input[{$tax_name}]";
    ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php 
    echo $tax_name;
    ?>" <?php 
    disabled(!$user_can_assign_terms);
    ?> aria-describedby="new-tag-<?php 
    echo $tax_name;
    ?>-desc"><?php 
    echo str_replace(',', $comma . ' ', $terms_to_edit);
    // textarea_escaped by esc_attr() 
    ?></textarea></p>
	</div>
	<?php 
    if ($user_can_assign_terms) {
        ?>
	<div class="ajaxtag hide-if-no-js">
		<label class="screen-reader-text" for="new-tag-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
		<input data-wp-taxonomy="<?php 
        echo $tax_name;
        ?>" type="text" id="new-tag-<?php 
        echo $tax_name;
        ?>" name="newtag[<?php 
        echo $tax_name;
        ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php 
        echo $tax_name;
        ?>-desc" value="" />
		<input type="button" class="button tagadd" value="<?php 
        esc_attr_e('Add');
        ?>" />
	</div>
	<p class="howto" id="new-tag-<?php 
        echo $tax_name;
        ?>-desc"><?php 
        echo $taxonomy->labels->separate_items_with_commas;
        ?></p>
	<?php 
    } elseif (empty($terms_to_edit)) {
        ?>
		<p><?php 
        echo $taxonomy->labels->no_terms;
        ?></p>
	<?php 
    }
    ?>
	</div>
	<ul class="tagchecklist" role="list"></ul>
</div>
	<?php 
    if ($user_can_assign_terms) {
        ?>
<p class="hide-if-no-js"><button type="button" class="button-link tagcloud-link" id="link-<?php 
        echo $tax_name;
        ?>" aria-expanded="false"><?php 
        echo $taxonomy->labels->choose_from_most_used;
        ?></button></p>
<?php 
    }
    ?>
	<?php 
}

WordPress Version: 4.9

/**
 * Display post tags form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Tags meta box arguments.
 *
 *     @type string   $id       Meta box 'id' attribute.
 *     @type string   $title    Meta box title.
 *     @type callable $callback Meta box display callback.
 *     @type array    $args {
 *         Extra meta box arguments.
 *
 *         @type string $taxonomy Taxonomy. Default 'post_tag'.
 *     }
 * }
 */
function post_tags_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'post_tag');
    if (!isset($box['args']) || !is_array($box['args'])) {
        $args = array();
    } else {
        $args = $box['args'];
    }
    $r = wp_parse_args($args, $defaults);
    $tax_name = esc_attr($r['taxonomy']);
    $taxonomy = get_taxonomy($r['taxonomy']);
    $user_can_assign_terms = current_user_can($taxonomy->cap->assign_terms);
    $comma = _x(',', 'tag delimiter');
    $terms_to_edit = get_terms_to_edit($post->ID, $tax_name);
    if (!is_string($terms_to_edit)) {
        $terms_to_edit = '';
    }
    ?>
<div class="tagsdiv" id="<?php 
    echo $tax_name;
    ?>">
	<div class="jaxtag">
	<div class="nojs-tags hide-if-js">
		<label for="tax-input-<?php 
    echo $tax_name;
    ?>"><?php 
    echo $taxonomy->labels->add_or_remove_items;
    ?></label>
		<p><textarea name="<?php 
    echo "tax_input[{$tax_name}]";
    ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php 
    echo $tax_name;
    ?>" <?php 
    disabled(!$user_can_assign_terms);
    ?> aria-describedby="new-tag-<?php 
    echo $tax_name;
    ?>-desc"><?php 
    echo str_replace(',', $comma . ' ', $terms_to_edit);
    // textarea_escaped by esc_attr() 
    ?></textarea></p>
	</div>
 	<?php 
    if ($user_can_assign_terms) {
        ?>
	<div class="ajaxtag hide-if-no-js">
		<label class="screen-reader-text" for="new-tag-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
		<p><input data-wp-taxonomy="<?php 
        echo $tax_name;
        ?>" type="text" id="new-tag-<?php 
        echo $tax_name;
        ?>" name="newtag[<?php 
        echo $tax_name;
        ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php 
        echo $tax_name;
        ?>-desc" value="" />
		<input type="button" class="button tagadd" value="<?php 
        esc_attr_e('Add');
        ?>" /></p>
	</div>
	<p class="howto" id="new-tag-<?php 
        echo $tax_name;
        ?>-desc"><?php 
        echo $taxonomy->labels->separate_items_with_commas;
        ?></p>
	<?php 
    } elseif (empty($terms_to_edit)) {
        ?>
		<p><?php 
        echo $taxonomy->labels->no_terms;
        ?></p>
	<?php 
    }
    ?>
	</div>
	<ul class="tagchecklist" role="list"></ul>
</div>
<?php 
    if ($user_can_assign_terms) {
        ?>
<p class="hide-if-no-js"><button type="button" class="button-link tagcloud-link" id="link-<?php 
        echo $tax_name;
        ?>" aria-expanded="false"><?php 
        echo $taxonomy->labels->choose_from_most_used;
        ?></button></p>
<?php 
    }
}

WordPress Version: 4.7

/**
 * Display post tags form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Tags meta box arguments.
 *
 *     @type string   $id       Meta box 'id' attribute.
 *     @type string   $title    Meta box title.
 *     @type callable $callback Meta box display callback.
 *     @type array    $args {
 *         Extra meta box arguments.
 *
 *         @type string $taxonomy Taxonomy. Default 'post_tag'.
 *     }
 * }
 */
function post_tags_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'post_tag');
    if (!isset($box['args']) || !is_array($box['args'])) {
        $args = array();
    } else {
        $args = $box['args'];
    }
    $r = wp_parse_args($args, $defaults);
    $tax_name = esc_attr($r['taxonomy']);
    $taxonomy = get_taxonomy($r['taxonomy']);
    $user_can_assign_terms = current_user_can($taxonomy->cap->assign_terms);
    $comma = _x(',', 'tag delimiter');
    $terms_to_edit = get_terms_to_edit($post->ID, $tax_name);
    if (!is_string($terms_to_edit)) {
        $terms_to_edit = '';
    }
    ?>
<div class="tagsdiv" id="<?php 
    echo $tax_name;
    ?>">
	<div class="jaxtag">
	<div class="nojs-tags hide-if-js">
		<label for="tax-input-<?php 
    echo $tax_name;
    ?>"><?php 
    echo $taxonomy->labels->add_or_remove_items;
    ?></label>
		<p><textarea name="<?php 
    echo "tax_input[{$tax_name}]";
    ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php 
    echo $tax_name;
    ?>" <?php 
    disabled(!$user_can_assign_terms);
    ?> aria-describedby="new-tag-<?php 
    echo $tax_name;
    ?>-desc"><?php 
    echo str_replace(',', $comma . ' ', $terms_to_edit);
    // textarea_escaped by esc_attr() 
    ?></textarea></p>
	</div>
 	<?php 
    if ($user_can_assign_terms) {
        ?>
	<div class="ajaxtag hide-if-no-js">
		<label class="screen-reader-text" for="new-tag-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
		<p><input data-wp-taxonomy="<?php 
        echo $tax_name;
        ?>" type="text" id="new-tag-<?php 
        echo $tax_name;
        ?>" name="newtag[<?php 
        echo $tax_name;
        ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php 
        echo $tax_name;
        ?>-desc" value="" />
		<input type="button" class="button tagadd" value="<?php 
        esc_attr_e('Add');
        ?>" /></p>
	</div>
	<p class="howto" id="new-tag-<?php 
        echo $tax_name;
        ?>-desc"><?php 
        echo $taxonomy->labels->separate_items_with_commas;
        ?></p>
	<?php 
    } elseif (empty($terms_to_edit)) {
        ?>
		<p><?php 
        echo $taxonomy->labels->no_terms;
        ?></p>
	<?php 
    }
    ?>
	</div>
	<div class="tagchecklist"></div>
</div>
<?php 
    if ($user_can_assign_terms) {
        ?>
<p class="hide-if-no-js"><button type="button" class="button-link tagcloud-link" id="link-<?php 
        echo $tax_name;
        ?>" aria-expanded="false"><?php 
        echo $taxonomy->labels->choose_from_most_used;
        ?></button></p>
<?php 
    }
}

WordPress Version: 4.6

/**
 * Display post tags form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Tags meta box arguments.
 *
 *     @type string   $id       Meta box 'id' attribute.
 *     @type string   $title    Meta box title.
 *     @type callable $callback Meta box display callback.
 *     @type array    $args {
 *         Extra meta box arguments.
 *
 *         @type string $taxonomy Taxonomy. Default 'post_tag'.
 *     }
 * }
 */
function post_tags_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'post_tag');
    if (!isset($box['args']) || !is_array($box['args'])) {
        $args = array();
    } else {
        $args = $box['args'];
    }
    $r = wp_parse_args($args, $defaults);
    $tax_name = esc_attr($r['taxonomy']);
    $taxonomy = get_taxonomy($r['taxonomy']);
    $user_can_assign_terms = current_user_can($taxonomy->cap->assign_terms);
    $comma = _x(',', 'tag delimiter');
    $terms_to_edit = get_terms_to_edit($post->ID, $tax_name);
    if (!is_string($terms_to_edit)) {
        $terms_to_edit = '';
    }
    ?>
<div class="tagsdiv" id="<?php 
    echo $tax_name;
    ?>">
	<div class="jaxtag">
	<div class="nojs-tags hide-if-js">
		<label for="tax-input-<?php 
    echo $tax_name;
    ?>"><?php 
    echo $taxonomy->labels->add_or_remove_items;
    ?></label>
		<p><textarea name="<?php 
    echo "tax_input[{$tax_name}]";
    ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php 
    echo $tax_name;
    ?>" <?php 
    disabled(!$user_can_assign_terms);
    ?> aria-describedby="new-tag-<?php 
    echo $tax_name;
    ?>-desc"><?php 
    echo str_replace(',', $comma . ' ', $terms_to_edit);
    // textarea_escaped by esc_attr() 
    ?></textarea></p>
	</div>
 	<?php 
    if ($user_can_assign_terms) {
        ?>
	<div class="ajaxtag hide-if-no-js">
		<label class="screen-reader-text" for="new-tag-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
		<p><input type="text" id="new-tag-<?php 
        echo $tax_name;
        ?>" name="newtag[<?php 
        echo $tax_name;
        ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php 
        echo $tax_name;
        ?>-desc" value="" />
		<input type="button" class="button tagadd" value="<?php 
        esc_attr_e('Add');
        ?>" /></p>
	</div>
	<p class="howto" id="new-tag-<?php 
        echo $tax_name;
        ?>-desc"><?php 
        echo $taxonomy->labels->separate_items_with_commas;
        ?></p>
	<?php 
    }
    ?>
	</div>
	<div class="tagchecklist"></div>
</div>
<?php 
    if ($user_can_assign_terms) {
        ?>
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->choose_from_most_used;
        ?></a></p>
<?php 
    }
}

WordPress Version: 4.4

/**
 * Display post tags form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Tags meta box arguments.
 *
 *     @type string   $id       Meta box ID.
 *     @type string   $title    Meta box title.
 *     @type callable $callback Meta box display callback.
 *     @type array    $args {
 *         Extra meta box arguments.
 *
 *         @type string $taxonomy Taxonomy. Default 'post_tag'.
 *     }
 * }
 */
function post_tags_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'post_tag');
    if (!isset($box['args']) || !is_array($box['args'])) {
        $args = array();
    } else {
        $args = $box['args'];
    }
    $r = wp_parse_args($args, $defaults);
    $tax_name = esc_attr($r['taxonomy']);
    $taxonomy = get_taxonomy($r['taxonomy']);
    $user_can_assign_terms = current_user_can($taxonomy->cap->assign_terms);
    $comma = _x(',', 'tag delimiter');
    $terms_to_edit = get_terms_to_edit($post->ID, $tax_name);
    if (!is_string($terms_to_edit)) {
        $terms_to_edit = '';
    }
    ?>
<div class="tagsdiv" id="<?php 
    echo $tax_name;
    ?>">
	<div class="jaxtag">
	<div class="nojs-tags hide-if-js">
		<label for="tax-input-<?php 
    echo $tax_name;
    ?>"><?php 
    echo $taxonomy->labels->add_or_remove_items;
    ?></label>
		<p><textarea name="<?php 
    echo "tax_input[{$tax_name}]";
    ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php 
    echo $tax_name;
    ?>" <?php 
    disabled(!$user_can_assign_terms);
    ?> aria-describedby="new-tag-<?php 
    echo $tax_name;
    ?>-desc"><?php 
    echo str_replace(',', $comma . ' ', $terms_to_edit);
    // textarea_escaped by esc_attr() 
    ?></textarea></p>
	</div>
 	<?php 
    if ($user_can_assign_terms) {
        ?>
	<div class="ajaxtag hide-if-no-js">
		<label class="screen-reader-text" for="new-tag-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
		<p><input type="text" id="new-tag-<?php 
        echo $tax_name;
        ?>" name="newtag[<?php 
        echo $tax_name;
        ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php 
        echo $tax_name;
        ?>-desc" value="" />
		<input type="button" class="button tagadd" value="<?php 
        esc_attr_e('Add');
        ?>" /></p>
	</div>
	<p class="howto" id="new-tag-<?php 
        echo $tax_name;
        ?>-desc"><?php 
        echo $taxonomy->labels->separate_items_with_commas;
        ?></p>
	<?php 
    }
    ?>
	</div>
	<div class="tagchecklist"></div>
</div>
<?php 
    if ($user_can_assign_terms) {
        ?>
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->choose_from_most_used;
        ?></a></p>
<?php 
    }
}

WordPress Version: 4.2

/**
 * Display post tags form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Tags meta box arguments.
 *
 *     @type string   $id       Meta box ID.
 *     @type string   $title    Meta box title.
 *     @type callback $callback Meta box display callback.
 *     @type array    $args {
 *         Extra meta box arguments.
 *
 *         @type string $taxonomy Taxonomy. Default 'post_tag'.
 *     }
 * }
 */
function post_tags_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'post_tag');
    if (!isset($box['args']) || !is_array($box['args'])) {
        $args = array();
    } else {
        $args = $box['args'];
    }
    $r = wp_parse_args($args, $defaults);
    $tax_name = esc_attr($r['taxonomy']);
    $taxonomy = get_taxonomy($r['taxonomy']);
    $user_can_assign_terms = current_user_can($taxonomy->cap->assign_terms);
    $comma = _x(',', 'tag delimiter');
    ?>
<div class="tagsdiv" id="<?php 
    echo $tax_name;
    ?>">
	<div class="jaxtag">
	<div class="nojs-tags hide-if-js">
	<p><?php 
    echo $taxonomy->labels->add_or_remove_items;
    ?></p>
	<textarea name="<?php 
    echo "tax_input[{$tax_name}]";
    ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php 
    echo $tax_name;
    ?>" <?php 
    disabled(!$user_can_assign_terms);
    ?>><?php 
    echo str_replace(',', $comma . ' ', get_terms_to_edit($post->ID, $tax_name));
    // textarea_escaped by esc_attr() 
    ?></textarea></div>
 	<?php 
    if ($user_can_assign_terms) {
        ?>
	<div class="ajaxtag hide-if-no-js">
		<label class="screen-reader-text" for="new-tag-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $box['title'];
        ?></label>
		<p><input type="text" id="new-tag-<?php 
        echo $tax_name;
        ?>" name="newtag[<?php 
        echo $tax_name;
        ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
		<input type="button" class="button tagadd" value="<?php 
        esc_attr_e('Add');
        ?>" /></p>
	</div>
	<p class="howto"><?php 
        echo $taxonomy->labels->separate_items_with_commas;
        ?></p>
	<?php 
    }
    ?>
	</div>
	<div class="tagchecklist"></div>
</div>
<?php 
    if ($user_can_assign_terms) {
        ?>
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->choose_from_most_used;
        ?></a></p>
<?php 
    }
}

WordPress Version: 4.0

/**
 * Display post tags form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Tags meta box arguments.
 *
 *     @type string   $id       Meta box ID.
 *     @type string   $title    Meta box title.
 *     @type callback $callback Meta box display callback.
 *     @type array    $args {
 *         Extra meta box arguments.
 *
 *         @type string $taxonomy Taxonomy. Default 'post_tag'.
 *     }
 * }
 */
function post_tags_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'post_tag');
    if (!isset($box['args']) || !is_array($box['args'])) {
        $args = array();
    } else {
        $args = $box['args'];
    }
    $r = wp_parse_args($args, $defaults);
    $tax_name = esc_attr($r['taxonomy']);
    $taxonomy = get_taxonomy($r['taxonomy']);
    $user_can_assign_terms = current_user_can($taxonomy->cap->assign_terms);
    $comma = _x(',', 'tag delimiter');
    ?>
<div class="tagsdiv" id="<?php 
    echo $tax_name;
    ?>">
	<div class="jaxtag">
	<div class="nojs-tags hide-if-js">
	<p><?php 
    echo $taxonomy->labels->add_or_remove_items;
    ?></p>
	<textarea name="<?php 
    echo "tax_input[{$tax_name}]";
    ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php 
    echo $tax_name;
    ?>" <?php 
    disabled(!$user_can_assign_terms);
    ?>><?php 
    echo str_replace(',', $comma . ' ', get_terms_to_edit($post->ID, $tax_name));
    // textarea_escaped by esc_attr() 
    ?></textarea></div>
 	<?php 
    if ($user_can_assign_terms) {
        ?>
	<div class="ajaxtag hide-if-no-js">
		<label class="screen-reader-text" for="new-tag-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $box['title'];
        ?></label>
		<div class="taghint"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></div>
		<p><input type="text" id="new-tag-<?php 
        echo $tax_name;
        ?>" name="newtag[<?php 
        echo $tax_name;
        ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
		<input type="button" class="button tagadd" value="<?php 
        esc_attr_e('Add');
        ?>" /></p>
	</div>
	<p class="howto"><?php 
        echo $taxonomy->labels->separate_items_with_commas;
        ?></p>
	<?php 
    }
    ?>
	</div>
	<div class="tagchecklist"></div>
</div>
<?php 
    if ($user_can_assign_terms) {
        ?>
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->choose_from_most_used;
        ?></a></p>
<?php 
    }
}

WordPress Version: 3.7

/**
 * Display post tags form fields.
 *
 * @since 2.6.0
 *
 * @param object $post
 */
function post_tags_meta_box($post, $box)
{
    $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);
    $user_can_assign_terms = current_user_can($taxonomy->cap->assign_terms);
    $comma = _x(',', 'tag delimiter');
    ?>
<div class="tagsdiv" id="<?php 
    echo $tax_name;
    ?>">
	<div class="jaxtag">
	<div class="nojs-tags hide-if-js">
	<p><?php 
    echo $taxonomy->labels->add_or_remove_items;
    ?></p>
	<textarea name="<?php 
    echo "tax_input[{$tax_name}]";
    ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php 
    echo $tax_name;
    ?>" <?php 
    disabled(!$user_can_assign_terms);
    ?>><?php 
    echo str_replace(',', $comma . ' ', get_terms_to_edit($post->ID, $tax_name));
    // textarea_escaped by esc_attr() 
    ?></textarea></div>
 	<?php 
    if ($user_can_assign_terms) {
        ?>
	<div class="ajaxtag hide-if-no-js">
		<label class="screen-reader-text" for="new-tag-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $box['title'];
        ?></label>
		<div class="taghint"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></div>
		<p><input type="text" id="new-tag-<?php 
        echo $tax_name;
        ?>" name="newtag[<?php 
        echo $tax_name;
        ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
		<input type="button" class="button tagadd" value="<?php 
        esc_attr_e('Add');
        ?>" /></p>
	</div>
	<p class="howto"><?php 
        echo $taxonomy->labels->separate_items_with_commas;
        ?></p>
	<?php 
    }
    ?>
	</div>
	<div class="tagchecklist"></div>
</div>
<?php 
    if ($user_can_assign_terms) {
        ?>
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->choose_from_most_used;
        ?></a></p>
<?php 
    }
}