Need help? Check out our Support site, then

What does the $box stand for in post_tags_meta_box() function?

  1. Hello.
    I would like to know what does the $box stand for in post_tags_meta_box($post, $box) function and what type of variable I must define for it?
    This function is located in /wp-admin/includes/meta-boxes.php file?

    I want to connect it with my plugin and custom posts (type) and need to understand the meaning of $box.

    Here is the full code:

    function post_tags_meta_box($post, $box) {
    $defaults = array('taxonomy' => 'post_tag');
    if ( !isset($box['args']) || !is_array($box['args']) )
    $args = array();
    $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>
    <p class="howto"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p>
    <?php endif; ?>
    <div class="tagchecklist"></div>
    <?php if ( $user_can_assign_terms ) : ?>
    <p class="hide-if-no-js">"><?php echo $taxonomy->labels->choose_from_most_used; ?></p>
    <?php endif; ?>

    Thanks in advance!

    The blog I need help with is

Topic Closed

This topic has been closed to new replies.

About this Topic