post_categories_meta_box

The timeline below displays how wordpress function post_categories_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 categories form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Current post object.
 * @param array   $box {
 *     Categories 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 'category'.
 *     }
 * }
 */
function post_categories_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'category');
    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']);
    ?>
	<div id="taxonomy-<?php 
    echo $tax_name;
    ?>" class="categorydiv">
		<ul id="<?php 
    echo $tax_name;
    ?>-tabs" class="category-tabs">
			<li class="tabs"><a href="#<?php 
    echo $tax_name;
    ?>-all"><?php 
    echo $taxonomy->labels->all_items;
    ?></a></li>
			<li class="hide-if-no-js"><a href="#<?php 
    echo $tax_name;
    ?>-pop"><?php 
    echo esc_html($taxonomy->labels->most_used);
    ?></a></li>
		</ul>

		<div id="<?php 
    echo $tax_name;
    ?>-pop" class="tabs-panel" style="display: none;">
			<ul id="<?php 
    echo $tax_name;
    ?>checklist-pop" class="categorychecklist form-no-clear" >
				<?php 
    $popular_ids = wp_popular_terms_checklist($tax_name);
    ?>
			</ul>
		</div>

		<div id="<?php 
    echo $tax_name;
    ?>-all" class="tabs-panel">
			<?php 
    $name = ('category' === $tax_name) ? 'post_category' : ('tax_input[' . $tax_name . ']');
    // Allows for an empty term set to be sent. 0 is an invalid term ID and will be ignored by empty() checks.
    echo "<input type='hidden' name='{$name}[]' value='0' />";
    ?>
			<ul id="<?php 
    echo $tax_name;
    ?>checklist" data-wp-lists="list:<?php 
    echo $tax_name;
    ?>" class="categorychecklist form-no-clear">
				<?php 
    wp_terms_checklist($post->ID, array('taxonomy' => $tax_name, 'popular_cats' => $popular_ids));
    ?>
			</ul>
		</div>
	<?php 
    if (current_user_can($taxonomy->cap->edit_terms)) {
        ?>
			<div id="<?php 
        echo $tax_name;
        ?>-adder" class="wp-hidden-children">
				<a id="<?php 
        echo $tax_name;
        ?>-add-toggle" href="#<?php 
        echo $tax_name;
        ?>-add" class="hide-if-no-js taxonomy-add-new">
					<?php 
        /* translators: %s: Add New taxonomy label. */
        printf(__('+ %s'), $taxonomy->labels->add_new_item);
        ?>
				</a>
				<p id="<?php 
        echo $tax_name;
        ?>-add" class="category-add wp-hidden-child">
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
					<input type="text" name="new<?php 
        echo $tax_name;
        ?>" id="new<?php 
        echo $tax_name;
        ?>" class="form-required form-input-tip" value="<?php 
        echo esc_attr($taxonomy->labels->new_item_name);
        ?>" aria-required="true" />
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>_parent">
						<?php 
        echo $taxonomy->labels->parent_item_colon;
        ?>
					</label>
					<?php 
        $parent_dropdown_args = array('taxonomy' => $tax_name, 'hide_empty' => 0, 'name' => 'new' . $tax_name . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;');
        /**
         * Filters the arguments for the taxonomy parent dropdown on the Post Edit page.
         *
         * @since 4.4.0
         *
         * @param array $parent_dropdown_args {
         *     Optional. Array of arguments to generate parent dropdown.
         *
         *     @type string   $taxonomy         Name of the taxonomy to retrieve.
         *     @type bool     $hide_if_empty    True to skip generating markup if no
         *                                      categories are found. Default 0.
         *     @type string   $name             Value for the 'name' attribute
         *                                      of the select element.
         *                                      Default "new{$tax_name}_parent".
         *     @type string   $orderby          Which column to use for ordering
         *                                      terms. Default 'name'.
         *     @type bool|int $hierarchical     Whether to traverse the taxonomy
         *                                      hierarchy. Default 1.
         *     @type string   $show_option_none Text to display for the "none" option.
         *                                      Default "&mdash; {$parent} &mdash;",
         *                                      where `$parent` is 'parent_item'
         *                                      taxonomy label.
         * }
         */
        $parent_dropdown_args = apply_filters('post_edit_category_parent_dropdown_args', $parent_dropdown_args);
        wp_dropdown_categories($parent_dropdown_args);
        ?>
					<input type="button" id="<?php 
        echo $tax_name;
        ?>-add-submit" data-wp-lists="add:<?php 
        echo $tax_name;
        ?>checklist:<?php 
        echo $tax_name;
        ?>-add" class="button category-add-submit" value="<?php 
        echo esc_attr($taxonomy->labels->add_new_item);
        ?>" />
					<?php 
        wp_nonce_field('add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false);
        ?>
					<span id="<?php 
        echo $tax_name;
        ?>-ajax-response"></span>
				</p>
			</div>
		<?php 
    }
    ?>
	</div>
	<?php 
}

WordPress Version: 5.8

/**
 * Display post categories form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Categories 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 'category'.
 *     }
 * }
 */
function post_categories_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'category');
    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']);
    ?>
	<div id="taxonomy-<?php 
    echo $tax_name;
    ?>" class="categorydiv">
		<ul id="<?php 
    echo $tax_name;
    ?>-tabs" class="category-tabs">
			<li class="tabs"><a href="#<?php 
    echo $tax_name;
    ?>-all"><?php 
    echo $taxonomy->labels->all_items;
    ?></a></li>
			<li class="hide-if-no-js"><a href="#<?php 
    echo $tax_name;
    ?>-pop"><?php 
    echo esc_html($taxonomy->labels->most_used);
    ?></a></li>
		</ul>

		<div id="<?php 
    echo $tax_name;
    ?>-pop" class="tabs-panel" style="display: none;">
			<ul id="<?php 
    echo $tax_name;
    ?>checklist-pop" class="categorychecklist form-no-clear" >
				<?php 
    $popular_ids = wp_popular_terms_checklist($tax_name);
    ?>
			</ul>
		</div>

		<div id="<?php 
    echo $tax_name;
    ?>-all" class="tabs-panel">
			<?php 
    $name = ('category' === $tax_name) ? 'post_category' : ('tax_input[' . $tax_name . ']');
    // Allows for an empty term set to be sent. 0 is an invalid term ID and will be ignored by empty() checks.
    echo "<input type='hidden' name='{$name}[]' value='0' />";
    ?>
			<ul id="<?php 
    echo $tax_name;
    ?>checklist" data-wp-lists="list:<?php 
    echo $tax_name;
    ?>" class="categorychecklist form-no-clear">
				<?php 
    wp_terms_checklist($post->ID, array('taxonomy' => $tax_name, 'popular_cats' => $popular_ids));
    ?>
			</ul>
		</div>
	<?php 
    if (current_user_can($taxonomy->cap->edit_terms)) {
        ?>
			<div id="<?php 
        echo $tax_name;
        ?>-adder" class="wp-hidden-children">
				<a id="<?php 
        echo $tax_name;
        ?>-add-toggle" href="#<?php 
        echo $tax_name;
        ?>-add" class="hide-if-no-js taxonomy-add-new">
					<?php 
        /* translators: %s: Add New taxonomy label. */
        printf(__('+ %s'), $taxonomy->labels->add_new_item);
        ?>
				</a>
				<p id="<?php 
        echo $tax_name;
        ?>-add" class="category-add wp-hidden-child">
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
					<input type="text" name="new<?php 
        echo $tax_name;
        ?>" id="new<?php 
        echo $tax_name;
        ?>" class="form-required form-input-tip" value="<?php 
        echo esc_attr($taxonomy->labels->new_item_name);
        ?>" aria-required="true" />
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>_parent">
						<?php 
        echo $taxonomy->labels->parent_item_colon;
        ?>
					</label>
					<?php 
        $parent_dropdown_args = array('taxonomy' => $tax_name, 'hide_empty' => 0, 'name' => 'new' . $tax_name . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;');
        /**
         * Filters the arguments for the taxonomy parent dropdown on the Post Edit page.
         *
         * @since 4.4.0
         *
         * @param array $parent_dropdown_args {
         *     Optional. Array of arguments to generate parent dropdown.
         *
         *     @type string   $taxonomy         Name of the taxonomy to retrieve.
         *     @type bool     $hide_if_empty    True to skip generating markup if no
         *                                      categories are found. Default 0.
         *     @type string   $name             Value for the 'name' attribute
         *                                      of the select element.
         *                                      Default "new{$tax_name}_parent".
         *     @type string   $orderby          Which column to use for ordering
         *                                      terms. Default 'name'.
         *     @type bool|int $hierarchical     Whether to traverse the taxonomy
         *                                      hierarchy. Default 1.
         *     @type string   $show_option_none Text to display for the "none" option.
         *                                      Default "&mdash; {$parent} &mdash;",
         *                                      where `$parent` is 'parent_item'
         *                                      taxonomy label.
         * }
         */
        $parent_dropdown_args = apply_filters('post_edit_category_parent_dropdown_args', $parent_dropdown_args);
        wp_dropdown_categories($parent_dropdown_args);
        ?>
					<input type="button" id="<?php 
        echo $tax_name;
        ?>-add-submit" data-wp-lists="add:<?php 
        echo $tax_name;
        ?>checklist:<?php 
        echo $tax_name;
        ?>-add" class="button category-add-submit" value="<?php 
        echo esc_attr($taxonomy->labels->add_new_item);
        ?>" />
					<?php 
        wp_nonce_field('add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false);
        ?>
					<span id="<?php 
        echo $tax_name;
        ?>-ajax-response"></span>
				</p>
			</div>
		<?php 
    }
    ?>
	</div>
	<?php 
}

WordPress Version: 5.4

/**
 * Display post categories form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Categories 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 'category'.
 *     }
 * }
 */
function post_categories_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'category');
    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']);
    ?>
	<div id="taxonomy-<?php 
    echo $tax_name;
    ?>" class="categorydiv">
		<ul id="<?php 
    echo $tax_name;
    ?>-tabs" class="category-tabs">
			<li class="tabs"><a href="#<?php 
    echo $tax_name;
    ?>-all"><?php 
    echo $taxonomy->labels->all_items;
    ?></a></li>
			<li class="hide-if-no-js"><a href="#<?php 
    echo $tax_name;
    ?>-pop"><?php 
    echo esc_html($taxonomy->labels->most_used);
    ?></a></li>
		</ul>

		<div id="<?php 
    echo $tax_name;
    ?>-pop" class="tabs-panel" style="display: none;">
			<ul id="<?php 
    echo $tax_name;
    ?>checklist-pop" class="categorychecklist form-no-clear" >
				<?php 
    $popular_ids = wp_popular_terms_checklist($tax_name);
    ?>
			</ul>
		</div>

		<div id="<?php 
    echo $tax_name;
    ?>-all" class="tabs-panel">
			<?php 
    $name = ('category' === $tax_name) ? 'post_category' : ('tax_input[' . $tax_name . ']');
    // Allows for an empty term set to be sent. 0 is an invalid term ID and will be ignored by empty() checks.
    echo "<input type='hidden' name='{$name}[]' value='0' />";
    ?>
			<ul id="<?php 
    echo $tax_name;
    ?>checklist" data-wp-lists="list:<?php 
    echo $tax_name;
    ?>" class="categorychecklist form-no-clear">
				<?php 
    wp_terms_checklist($post->ID, array('taxonomy' => $tax_name, 'popular_cats' => $popular_ids));
    ?>
			</ul>
		</div>
	<?php 
    if (current_user_can($taxonomy->cap->edit_terms)) {
        ?>
			<div id="<?php 
        echo $tax_name;
        ?>-adder" class="wp-hidden-children">
				<a id="<?php 
        echo $tax_name;
        ?>-add-toggle" href="#<?php 
        echo $tax_name;
        ?>-add" class="hide-if-no-js taxonomy-add-new">
					<?php 
        /* translators: %s: Add New taxonomy label. */
        printf(__('+ %s'), $taxonomy->labels->add_new_item);
        ?>
				</a>
				<p id="<?php 
        echo $tax_name;
        ?>-add" class="category-add wp-hidden-child">
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
					<input type="text" name="new<?php 
        echo $tax_name;
        ?>" id="new<?php 
        echo $tax_name;
        ?>" class="form-required form-input-tip" value="<?php 
        echo esc_attr($taxonomy->labels->new_item_name);
        ?>" aria-required="true"/>
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>_parent">
						<?php 
        echo $taxonomy->labels->parent_item_colon;
        ?>
					</label>
					<?php 
        $parent_dropdown_args = array('taxonomy' => $tax_name, 'hide_empty' => 0, 'name' => 'new' . $tax_name . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;');
        /**
         * Filters the arguments for the taxonomy parent dropdown on the Post Edit page.
         *
         * @since 4.4.0
         *
         * @param array $parent_dropdown_args {
         *     Optional. Array of arguments to generate parent dropdown.
         *
         *     @type string   $taxonomy         Name of the taxonomy to retrieve.
         *     @type bool     $hide_if_empty    True to skip generating markup if no
         *                                      categories are found. Default 0.
         *     @type string   $name             Value for the 'name' attribute
         *                                      of the select element.
         *                                      Default "new{$tax_name}_parent".
         *     @type string   $orderby          Which column to use for ordering
         *                                      terms. Default 'name'.
         *     @type bool|int $hierarchical     Whether to traverse the taxonomy
         *                                      hierarchy. Default 1.
         *     @type string   $show_option_none Text to display for the "none" option.
         *                                      Default "&mdash; {$parent} &mdash;",
         *                                      where `$parent` is 'parent_item'
         *                                      taxonomy label.
         * }
         */
        $parent_dropdown_args = apply_filters('post_edit_category_parent_dropdown_args', $parent_dropdown_args);
        wp_dropdown_categories($parent_dropdown_args);
        ?>
					<input type="button" id="<?php 
        echo $tax_name;
        ?>-add-submit" data-wp-lists="add:<?php 
        echo $tax_name;
        ?>checklist:<?php 
        echo $tax_name;
        ?>-add" class="button category-add-submit" value="<?php 
        echo esc_attr($taxonomy->labels->add_new_item);
        ?>" />
					<?php 
        wp_nonce_field('add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false);
        ?>
					<span id="<?php 
        echo $tax_name;
        ?>-ajax-response"></span>
				</p>
			</div>
		<?php 
    }
    ?>
	</div>
	<?php 
}

WordPress Version: 5.3

/**
 * Display post categories form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Categories 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 'category'.
 *     }
 * }
 */
function post_categories_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'category');
    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']);
    ?>
	<div id="taxonomy-<?php 
    echo $tax_name;
    ?>" class="categorydiv">
		<ul id="<?php 
    echo $tax_name;
    ?>-tabs" class="category-tabs">
			<li class="tabs"><a href="#<?php 
    echo $tax_name;
    ?>-all"><?php 
    echo $taxonomy->labels->all_items;
    ?></a></li>
			<li class="hide-if-no-js"><a href="#<?php 
    echo $tax_name;
    ?>-pop"><?php 
    echo esc_html($taxonomy->labels->most_used);
    ?></a></li>
		</ul>

		<div id="<?php 
    echo $tax_name;
    ?>-pop" class="tabs-panel" style="display: none;">
			<ul id="<?php 
    echo $tax_name;
    ?>checklist-pop" class="categorychecklist form-no-clear" >
				<?php 
    $popular_ids = wp_popular_terms_checklist($tax_name);
    ?>
			</ul>
		</div>

		<div id="<?php 
    echo $tax_name;
    ?>-all" class="tabs-panel">
			<?php 
    $name = ($tax_name == 'category') ? 'post_category' : ('tax_input[' . $tax_name . ']');
    echo "<input type='hidden' name='{$name}[]' value='0' />";
    // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
    ?>
			<ul id="<?php 
    echo $tax_name;
    ?>checklist" data-wp-lists="list:<?php 
    echo $tax_name;
    ?>" class="categorychecklist form-no-clear">
				<?php 
    wp_terms_checklist($post->ID, array('taxonomy' => $tax_name, 'popular_cats' => $popular_ids));
    ?>
			</ul>
		</div>
	<?php 
    if (current_user_can($taxonomy->cap->edit_terms)) {
        ?>
			<div id="<?php 
        echo $tax_name;
        ?>-adder" class="wp-hidden-children">
				<a id="<?php 
        echo $tax_name;
        ?>-add-toggle" href="#<?php 
        echo $tax_name;
        ?>-add" class="hide-if-no-js taxonomy-add-new">
					<?php 
        /* translators: %s: Add New taxonomy label. */
        printf(__('+ %s'), $taxonomy->labels->add_new_item);
        ?>
				</a>
				<p id="<?php 
        echo $tax_name;
        ?>-add" class="category-add wp-hidden-child">
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
					<input type="text" name="new<?php 
        echo $tax_name;
        ?>" id="new<?php 
        echo $tax_name;
        ?>" class="form-required form-input-tip" value="<?php 
        echo esc_attr($taxonomy->labels->new_item_name);
        ?>" aria-required="true"/>
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>_parent">
						<?php 
        echo $taxonomy->labels->parent_item_colon;
        ?>
					</label>
					<?php 
        $parent_dropdown_args = array('taxonomy' => $tax_name, 'hide_empty' => 0, 'name' => 'new' . $tax_name . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;');
        /**
         * Filters the arguments for the taxonomy parent dropdown on the Post Edit page.
         *
         * @since 4.4.0
         *
         * @param array $parent_dropdown_args {
         *     Optional. Array of arguments to generate parent dropdown.
         *
         *     @type string   $taxonomy         Name of the taxonomy to retrieve.
         *     @type bool     $hide_if_empty    True to skip generating markup if no
         *                                      categories are found. Default 0.
         *     @type string   $name             Value for the 'name' attribute
         *                                      of the select element.
         *                                      Default "new{$tax_name}_parent".
         *     @type string   $orderby          Which column to use for ordering
         *                                      terms. Default 'name'.
         *     @type bool|int $hierarchical     Whether to traverse the taxonomy
         *                                      hierarchy. Default 1.
         *     @type string   $show_option_none Text to display for the "none" option.
         *                                      Default "&mdash; {$parent} &mdash;",
         *                                      where `$parent` is 'parent_item'
         *                                      taxonomy label.
         * }
         */
        $parent_dropdown_args = apply_filters('post_edit_category_parent_dropdown_args', $parent_dropdown_args);
        wp_dropdown_categories($parent_dropdown_args);
        ?>
					<input type="button" id="<?php 
        echo $tax_name;
        ?>-add-submit" data-wp-lists="add:<?php 
        echo $tax_name;
        ?>checklist:<?php 
        echo $tax_name;
        ?>-add" class="button category-add-submit" value="<?php 
        echo esc_attr($taxonomy->labels->add_new_item);
        ?>" />
					<?php 
        wp_nonce_field('add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false);
        ?>
					<span id="<?php 
        echo $tax_name;
        ?>-ajax-response"></span>
				</p>
			</div>
		<?php 
    }
    ?>
	</div>
	<?php 
}

WordPress Version: 4.9

/**
 * Display post categories form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Categories 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 'category'.
 *     }
 * }
 */
function post_categories_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'category');
    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']);
    ?>
	<div id="taxonomy-<?php 
    echo $tax_name;
    ?>" class="categorydiv">
		<ul id="<?php 
    echo $tax_name;
    ?>-tabs" class="category-tabs">
			<li class="tabs"><a href="#<?php 
    echo $tax_name;
    ?>-all"><?php 
    echo $taxonomy->labels->all_items;
    ?></a></li>
			<li class="hide-if-no-js"><a href="#<?php 
    echo $tax_name;
    ?>-pop"><?php 
    echo esc_html($taxonomy->labels->most_used);
    ?></a></li>
		</ul>

		<div id="<?php 
    echo $tax_name;
    ?>-pop" class="tabs-panel" style="display: none;">
			<ul id="<?php 
    echo $tax_name;
    ?>checklist-pop" class="categorychecklist form-no-clear" >
				<?php 
    $popular_ids = wp_popular_terms_checklist($tax_name);
    ?>
			</ul>
		</div>

		<div id="<?php 
    echo $tax_name;
    ?>-all" class="tabs-panel">
			<?php 
    $name = ($tax_name == 'category') ? 'post_category' : ('tax_input[' . $tax_name . ']');
    echo "<input type='hidden' name='{$name}[]' value='0' />";
    // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
    ?>
			<ul id="<?php 
    echo $tax_name;
    ?>checklist" data-wp-lists="list:<?php 
    echo $tax_name;
    ?>" class="categorychecklist form-no-clear">
				<?php 
    wp_terms_checklist($post->ID, array('taxonomy' => $tax_name, 'popular_cats' => $popular_ids));
    ?>
			</ul>
		</div>
	<?php 
    if (current_user_can($taxonomy->cap->edit_terms)) {
        ?>
			<div id="<?php 
        echo $tax_name;
        ?>-adder" class="wp-hidden-children">
				<a id="<?php 
        echo $tax_name;
        ?>-add-toggle" href="#<?php 
        echo $tax_name;
        ?>-add" class="hide-if-no-js taxonomy-add-new">
					<?php 
        /* translators: %s: add new taxonomy label */
        printf(__('+ %s'), $taxonomy->labels->add_new_item);
        ?>
				</a>
				<p id="<?php 
        echo $tax_name;
        ?>-add" class="category-add wp-hidden-child">
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
					<input type="text" name="new<?php 
        echo $tax_name;
        ?>" id="new<?php 
        echo $tax_name;
        ?>" class="form-required form-input-tip" value="<?php 
        echo esc_attr($taxonomy->labels->new_item_name);
        ?>" aria-required="true"/>
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>_parent">
						<?php 
        echo $taxonomy->labels->parent_item_colon;
        ?>
					</label>
					<?php 
        $parent_dropdown_args = array('taxonomy' => $tax_name, 'hide_empty' => 0, 'name' => 'new' . $tax_name . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;');
        /**
         * Filters the arguments for the taxonomy parent dropdown on the Post Edit page.
         *
         * @since 4.4.0
         *
         * @param array $parent_dropdown_args {
         *     Optional. Array of arguments to generate parent dropdown.
         *
         *     @type string   $taxonomy         Name of the taxonomy to retrieve.
         *     @type bool     $hide_if_empty    True to skip generating markup if no
         *                                      categories are found. Default 0.
         *     @type string   $name             Value for the 'name' attribute
         *                                      of the select element.
         *                                      Default "new{$tax_name}_parent".
         *     @type string   $orderby          Which column to use for ordering
         *                                      terms. Default 'name'.
         *     @type bool|int $hierarchical     Whether to traverse the taxonomy
         *                                      hierarchy. Default 1.
         *     @type string   $show_option_none Text to display for the "none" option.
         *                                      Default "&mdash; {$parent} &mdash;",
         *                                      where `$parent` is 'parent_item'
         *                                      taxonomy label.
         * }
         */
        $parent_dropdown_args = apply_filters('post_edit_category_parent_dropdown_args', $parent_dropdown_args);
        wp_dropdown_categories($parent_dropdown_args);
        ?>
					<input type="button" id="<?php 
        echo $tax_name;
        ?>-add-submit" data-wp-lists="add:<?php 
        echo $tax_name;
        ?>checklist:<?php 
        echo $tax_name;
        ?>-add" class="button category-add-submit" value="<?php 
        echo esc_attr($taxonomy->labels->add_new_item);
        ?>" />
					<?php 
        wp_nonce_field('add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false);
        ?>
					<span id="<?php 
        echo $tax_name;
        ?>-ajax-response"></span>
				</p>
			</div>
		<?php 
    }
    ?>
	</div>
	<?php 
}

WordPress Version: 4.6

/**
 * Display post categories form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Categories 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 'category'.
 *     }
 * }
 */
function post_categories_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'category');
    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']);
    ?>
	<div id="taxonomy-<?php 
    echo $tax_name;
    ?>" class="categorydiv">
		<ul id="<?php 
    echo $tax_name;
    ?>-tabs" class="category-tabs">
			<li class="tabs"><a href="#<?php 
    echo $tax_name;
    ?>-all"><?php 
    echo $taxonomy->labels->all_items;
    ?></a></li>
			<li class="hide-if-no-js"><a href="#<?php 
    echo $tax_name;
    ?>-pop"><?php 
    _e('Most Used');
    ?></a></li>
		</ul>

		<div id="<?php 
    echo $tax_name;
    ?>-pop" class="tabs-panel" style="display: none;">
			<ul id="<?php 
    echo $tax_name;
    ?>checklist-pop" class="categorychecklist form-no-clear" >
				<?php 
    $popular_ids = wp_popular_terms_checklist($tax_name);
    ?>
			</ul>
		</div>

		<div id="<?php 
    echo $tax_name;
    ?>-all" class="tabs-panel">
			<?php 
    $name = ($tax_name == 'category') ? 'post_category' : ('tax_input[' . $tax_name . ']');
    echo "<input type='hidden' name='{$name}[]' value='0' />";
    // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
    ?>
			<ul id="<?php 
    echo $tax_name;
    ?>checklist" data-wp-lists="list:<?php 
    echo $tax_name;
    ?>" class="categorychecklist form-no-clear">
				<?php 
    wp_terms_checklist($post->ID, array('taxonomy' => $tax_name, 'popular_cats' => $popular_ids));
    ?>
			</ul>
		</div>
	<?php 
    if (current_user_can($taxonomy->cap->edit_terms)) {
        ?>
			<div id="<?php 
        echo $tax_name;
        ?>-adder" class="wp-hidden-children">
				<a id="<?php 
        echo $tax_name;
        ?>-add-toggle" href="#<?php 
        echo $tax_name;
        ?>-add" class="hide-if-no-js taxonomy-add-new">
					<?php 
        /* translators: %s: add new taxonomy label */
        printf(__('+ %s'), $taxonomy->labels->add_new_item);
        ?>
				</a>
				<p id="<?php 
        echo $tax_name;
        ?>-add" class="category-add wp-hidden-child">
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
					<input type="text" name="new<?php 
        echo $tax_name;
        ?>" id="new<?php 
        echo $tax_name;
        ?>" class="form-required form-input-tip" value="<?php 
        echo esc_attr($taxonomy->labels->new_item_name);
        ?>" aria-required="true"/>
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>_parent">
						<?php 
        echo $taxonomy->labels->parent_item_colon;
        ?>
					</label>
					<?php 
        $parent_dropdown_args = array('taxonomy' => $tax_name, 'hide_empty' => 0, 'name' => 'new' . $tax_name . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;');
        /**
         * Filters the arguments for the taxonomy parent dropdown on the Post Edit page.
         *
         * @since 4.4.0
         *
         * @param array $parent_dropdown_args {
         *     Optional. Array of arguments to generate parent dropdown.
         *
         *     @type string   $taxonomy         Name of the taxonomy to retrieve.
         *     @type bool     $hide_if_empty    True to skip generating markup if no
         *                                      categories are found. Default 0.
         *     @type string   $name             Value for the 'name' attribute
         *                                      of the select element.
         *                                      Default "new{$tax_name}_parent".
         *     @type string   $orderby          Which column to use for ordering
         *                                      terms. Default 'name'.
         *     @type bool|int $hierarchical     Whether to traverse the taxonomy
         *                                      hierarchy. Default 1.
         *     @type string   $show_option_none Text to display for the "none" option.
         *                                      Default "&mdash; {$parent} &mdash;",
         *                                      where `$parent` is 'parent_item'
         *                                      taxonomy label.
         * }
         */
        $parent_dropdown_args = apply_filters('post_edit_category_parent_dropdown_args', $parent_dropdown_args);
        wp_dropdown_categories($parent_dropdown_args);
        ?>
					<input type="button" id="<?php 
        echo $tax_name;
        ?>-add-submit" data-wp-lists="add:<?php 
        echo $tax_name;
        ?>checklist:<?php 
        echo $tax_name;
        ?>-add" class="button category-add-submit" value="<?php 
        echo esc_attr($taxonomy->labels->add_new_item);
        ?>" />
					<?php 
        wp_nonce_field('add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false);
        ?>
					<span id="<?php 
        echo $tax_name;
        ?>-ajax-response"></span>
				</p>
			</div>
		<?php 
    }
    ?>
	</div>
	<?php 
}

WordPress Version: 4.4

/**
 * Display post categories form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Categories 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 'category'.
 *     }
 * }
 */
function post_categories_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'category');
    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']);
    ?>
	<div id="taxonomy-<?php 
    echo $tax_name;
    ?>" class="categorydiv">
		<ul id="<?php 
    echo $tax_name;
    ?>-tabs" class="category-tabs">
			<li class="tabs"><a href="#<?php 
    echo $tax_name;
    ?>-all"><?php 
    echo $taxonomy->labels->all_items;
    ?></a></li>
			<li class="hide-if-no-js"><a href="#<?php 
    echo $tax_name;
    ?>-pop"><?php 
    _e('Most Used');
    ?></a></li>
		</ul>

		<div id="<?php 
    echo $tax_name;
    ?>-pop" class="tabs-panel" style="display: none;">
			<ul id="<?php 
    echo $tax_name;
    ?>checklist-pop" class="categorychecklist form-no-clear" >
				<?php 
    $popular_ids = wp_popular_terms_checklist($tax_name);
    ?>
			</ul>
		</div>

		<div id="<?php 
    echo $tax_name;
    ?>-all" class="tabs-panel">
			<?php 
    $name = ($tax_name == 'category') ? 'post_category' : ('tax_input[' . $tax_name . ']');
    echo "<input type='hidden' name='{$name}[]' value='0' />";
    // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
    ?>
			<ul id="<?php 
    echo $tax_name;
    ?>checklist" data-wp-lists="list:<?php 
    echo $tax_name;
    ?>" class="categorychecklist form-no-clear">
				<?php 
    wp_terms_checklist($post->ID, array('taxonomy' => $tax_name, 'popular_cats' => $popular_ids));
    ?>
			</ul>
		</div>
	<?php 
    if (current_user_can($taxonomy->cap->edit_terms)) {
        ?>
			<div id="<?php 
        echo $tax_name;
        ?>-adder" class="wp-hidden-children">
				<a id="<?php 
        echo $tax_name;
        ?>-add-toggle" href="#<?php 
        echo $tax_name;
        ?>-add" class="hide-if-no-js taxonomy-add-new">
					<?php 
        /* translators: %s: add new taxonomy label */
        printf(__('+ %s'), $taxonomy->labels->add_new_item);
        ?>
				</a>
				<p id="<?php 
        echo $tax_name;
        ?>-add" class="category-add wp-hidden-child">
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
					<input type="text" name="new<?php 
        echo $tax_name;
        ?>" id="new<?php 
        echo $tax_name;
        ?>" class="form-required form-input-tip" value="<?php 
        echo esc_attr($taxonomy->labels->new_item_name);
        ?>" aria-required="true"/>
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>_parent">
						<?php 
        echo $taxonomy->labels->parent_item_colon;
        ?>
					</label>
					<?php 
        $parent_dropdown_args = array('taxonomy' => $tax_name, 'hide_empty' => 0, 'name' => 'new' . $tax_name . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;');
        /**
         * Filter the arguments for the taxonomy parent dropdown on the Post Edit page.
         *
         * @since 4.4.0
         *
         * @param array $parent_dropdown_args {
         *     Optional. Array of arguments to generate parent dropdown.
         *
         *     @type string   $taxonomy         Name of the taxonomy to retrieve.
         *     @type bool     $hide_if_empty    True to skip generating markup if no
         *                                      categories are found. Default 0.
         *     @type string   $name             Value for the 'name' attribute
         *                                      of the select element.
         *                                      Default "new{$tax_name}_parent".
         *     @type string   $orderby          Which column to use for ordering
         *                                      terms. Default 'name'.
         *     @type bool|int $hierarchical     Whether to traverse the taxonomy
         *                                      hierarchy. Default 1.
         *     @type string   $show_option_none Text to display for the "none" option.
         *                                      Default "&mdash; {$parent} &mdash;",
         *                                      where `$parent` is 'parent_item'
         *                                      taxonomy label.
         * }
         */
        $parent_dropdown_args = apply_filters('post_edit_category_parent_dropdown_args', $parent_dropdown_args);
        wp_dropdown_categories($parent_dropdown_args);
        ?>
					<input type="button" id="<?php 
        echo $tax_name;
        ?>-add-submit" data-wp-lists="add:<?php 
        echo $tax_name;
        ?>checklist:<?php 
        echo $tax_name;
        ?>-add" class="button category-add-submit" value="<?php 
        echo esc_attr($taxonomy->labels->add_new_item);
        ?>" />
					<?php 
        wp_nonce_field('add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false);
        ?>
					<span id="<?php 
        echo $tax_name;
        ?>-ajax-response"></span>
				</p>
			</div>
		<?php 
    }
    ?>
	</div>
	<?php 
}

WordPress Version: 4.0

/**
 * Display post categories form fields.
 *
 * @since 2.6.0
 *
 * @todo Create taxonomy-agnostic wrapper for this.
 *
 * @param WP_Post $post Post object.
 * @param array   $box {
 *     Categories 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 'category'.
 *     }
 * }
 */
function post_categories_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'category');
    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']);
    ?>
	<div id="taxonomy-<?php 
    echo $tax_name;
    ?>" class="categorydiv">
		<ul id="<?php 
    echo $tax_name;
    ?>-tabs" class="category-tabs">
			<li class="tabs"><a href="#<?php 
    echo $tax_name;
    ?>-all"><?php 
    echo $taxonomy->labels->all_items;
    ?></a></li>
			<li class="hide-if-no-js"><a href="#<?php 
    echo $tax_name;
    ?>-pop"><?php 
    _e('Most Used');
    ?></a></li>
		</ul>

		<div id="<?php 
    echo $tax_name;
    ?>-pop" class="tabs-panel" style="display: none;">
			<ul id="<?php 
    echo $tax_name;
    ?>checklist-pop" class="categorychecklist form-no-clear" >
				<?php 
    $popular_ids = wp_popular_terms_checklist($tax_name);
    ?>
			</ul>
		</div>

		<div id="<?php 
    echo $tax_name;
    ?>-all" class="tabs-panel">
			<?php 
    $name = ($tax_name == 'category') ? 'post_category' : ('tax_input[' . $tax_name . ']');
    echo "<input type='hidden' name='{$name}[]' value='0' />";
    // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
    ?>
			<ul id="<?php 
    echo $tax_name;
    ?>checklist" data-wp-lists="list:<?php 
    echo $tax_name;
    ?>" class="categorychecklist form-no-clear">
				<?php 
    wp_terms_checklist($post->ID, array('taxonomy' => $tax_name, 'popular_cats' => $popular_ids));
    ?>
			</ul>
		</div>
	<?php 
    if (current_user_can($taxonomy->cap->edit_terms)) {
        ?>
			<div id="<?php 
        echo $tax_name;
        ?>-adder" class="wp-hidden-children">
				<h4>
					<a id="<?php 
        echo $tax_name;
        ?>-add-toggle" href="#<?php 
        echo $tax_name;
        ?>-add" class="hide-if-no-js">
						<?php 
        /* translators: %s: add new taxonomy label */
        printf(__('+ %s'), $taxonomy->labels->add_new_item);
        ?>
					</a>
				</h4>
				<p id="<?php 
        echo $tax_name;
        ?>-add" class="category-add wp-hidden-child">
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>"><?php 
        echo $taxonomy->labels->add_new_item;
        ?></label>
					<input type="text" name="new<?php 
        echo $tax_name;
        ?>" id="new<?php 
        echo $tax_name;
        ?>" class="form-required form-input-tip" value="<?php 
        echo esc_attr($taxonomy->labels->new_item_name);
        ?>" aria-required="true"/>
					<label class="screen-reader-text" for="new<?php 
        echo $tax_name;
        ?>_parent">
						<?php 
        echo $taxonomy->labels->parent_item_colon;
        ?>
					</label>
					<?php 
        wp_dropdown_categories(array('taxonomy' => $tax_name, 'hide_empty' => 0, 'name' => 'new' . $tax_name . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;'));
        ?>
					<input type="button" id="<?php 
        echo $tax_name;
        ?>-add-submit" data-wp-lists="add:<?php 
        echo $tax_name;
        ?>checklist:<?php 
        echo $tax_name;
        ?>-add" class="button category-add-submit" value="<?php 
        echo esc_attr($taxonomy->labels->add_new_item);
        ?>" />
					<?php 
        wp_nonce_field('add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false);
        ?>
					<span id="<?php 
        echo $tax_name;
        ?>-ajax-response"></span>
				</p>
			</div>
		<?php 
    }
    ?>
	</div>
	<?php 
}

WordPress Version: 3.7

/**
 * Display post categories form fields.
 *
 * @since 2.6.0
 *
 * @param object $post
 */
function post_categories_meta_box($post, $box)
{
    $defaults = array('taxonomy' => 'category');
    if (!isset($box['args']) || !is_array($box['args'])) {
        $args = array();
    } else {
        $args = $box['args'];
    }
    extract(wp_parse_args($args, $defaults), EXTR_SKIP);
    $tax = get_taxonomy($taxonomy);
    ?>
	<div id="taxonomy-<?php 
    echo $taxonomy;
    ?>" class="categorydiv">
		<ul id="<?php 
    echo $taxonomy;
    ?>-tabs" class="category-tabs">
			<li class="tabs"><a href="#<?php 
    echo $taxonomy;
    ?>-all"><?php 
    echo $tax->labels->all_items;
    ?></a></li>
			<li class="hide-if-no-js"><a href="#<?php 
    echo $taxonomy;
    ?>-pop"><?php 
    _e('Most Used');
    ?></a></li>
		</ul>

		<div id="<?php 
    echo $taxonomy;
    ?>-pop" class="tabs-panel" style="display: none;">
			<ul id="<?php 
    echo $taxonomy;
    ?>checklist-pop" class="categorychecklist form-no-clear" >
				<?php 
    $popular_ids = wp_popular_terms_checklist($taxonomy);
    ?>
			</ul>
		</div>

		<div id="<?php 
    echo $taxonomy;
    ?>-all" class="tabs-panel">
			<?php 
    $name = ($taxonomy == 'category') ? 'post_category' : ('tax_input[' . $taxonomy . ']');
    echo "<input type='hidden' name='{$name}[]' value='0' />";
    // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
    ?>
			<ul id="<?php 
    echo $taxonomy;
    ?>checklist" data-wp-lists="list:<?php 
    echo $taxonomy;
    ?>" class="categorychecklist form-no-clear">
				<?php 
    wp_terms_checklist($post->ID, array('taxonomy' => $taxonomy, 'popular_cats' => $popular_ids));
    ?>
			</ul>
		</div>
	<?php 
    if (current_user_can($tax->cap->edit_terms)) {
        ?>
			<div id="<?php 
        echo $taxonomy;
        ?>-adder" class="wp-hidden-children">
				<h4>
					<a id="<?php 
        echo $taxonomy;
        ?>-add-toggle" href="#<?php 
        echo $taxonomy;
        ?>-add" class="hide-if-no-js">
						<?php 
        /* translators: %s: add new taxonomy label */
        printf(__('+ %s'), $tax->labels->add_new_item);
        ?>
					</a>
				</h4>
				<p id="<?php 
        echo $taxonomy;
        ?>-add" class="category-add wp-hidden-child">
					<label class="screen-reader-text" for="new<?php 
        echo $taxonomy;
        ?>"><?php 
        echo $tax->labels->add_new_item;
        ?></label>
					<input type="text" name="new<?php 
        echo $taxonomy;
        ?>" id="new<?php 
        echo $taxonomy;
        ?>" class="form-required form-input-tip" value="<?php 
        echo esc_attr($tax->labels->new_item_name);
        ?>" aria-required="true"/>
					<label class="screen-reader-text" for="new<?php 
        echo $taxonomy;
        ?>_parent">
						<?php 
        echo $tax->labels->parent_item_colon;
        ?>
					</label>
					<?php 
        wp_dropdown_categories(array('taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => 'new' . $taxonomy . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $tax->labels->parent_item . ' &mdash;'));
        ?>
					<input type="button" id="<?php 
        echo $taxonomy;
        ?>-add-submit" data-wp-lists="add:<?php 
        echo $taxonomy;
        ?>checklist:<?php 
        echo $taxonomy;
        ?>-add" class="button category-add-submit" value="<?php 
        echo esc_attr($tax->labels->add_new_item);
        ?>" />
					<?php 
        wp_nonce_field('add-' . $taxonomy, '_ajax_nonce-add-' . $taxonomy, false);
        ?>
					<span id="<?php 
        echo $taxonomy;
        ?>-ajax-response"></span>
				</p>
			</div>
		<?php 
    }
    ?>
	</div>
	<?php 
}