WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/20/2010 02:39:58 AM (12 years ago)
Author:
dd32
Message:

Tabs are better than spaces. Whitespace cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/meta-boxes.php

    r13776 r13777  
    1414
    1515    $post_type = $post->post_type;
    16     $post_type_object = get_post_type_object($post_type);
     16    $post_type_object = get_post_type_object($post_type);
    1717    $type_cap = $post_type_object->capability_type;
    1818    $can_publish = current_user_can("publish_${type_cap}s");
     
    284284function post_categories_meta_box( $post, $box ) {
    285285    $defaults = array('taxonomy' => 'category');
    286     if ( !isset($box['args']) || !is_array($box['args']) )
    287         $args = array();
     286    if ( !isset($box['args']) || !is_array($box['args']) )
     287        $args = array();
    288288    else
    289289        $args = $box['args'];
    290     extract( wp_parse_args($args, $defaults), EXTR_SKIP );
     290    extract( wp_parse_args($args, $defaults), EXTR_SKIP );
    291291    $tax = get_taxonomy($taxonomy);
    292292
    293     ?>
    294     <div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv">
    295         <ul id="<?php echo $taxonomy; ?>-tabs" class="category-tabs">
    296             <li class="tabs"><a href="#<?php echo $taxonomy; ?>-all" tabindex="3"><?php printf( __( 'All %s' ), $tax->label ); ?></a></li>
    297             <li class="hide-if-no-js"><a href="#<?php echo $taxonomy; ?>-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
    298         </ul>
     293    ?>
     294    <div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv">
     295        <ul id="<?php echo $taxonomy; ?>-tabs" class="category-tabs">
     296            <li class="tabs"><a href="#<?php echo $taxonomy; ?>-all" tabindex="3"><?php printf( __( 'All %s' ), $tax->label ); ?></a></li>
     297            <li class="hide-if-no-js"><a href="#<?php echo $taxonomy; ?>-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
     298        </ul>
    299299
    300300        <div id="<?php echo $taxonomy; ?>-pop" class="tabs-panel" style="display: none;">
     
    310310        </div>
    311311
    312     <?php if ( current_user_can($tax->edit_cap) ) : ?>
    313             <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children">
    314                 <h4><a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js" tabindex="3"><?php printf( __( '+ Add New %s' ), $tax->singular_label ); ?></a></h4>
    315                 <p id="<?php echo $taxonomy; ?>-add" class="category-add wp-hidden-child">
    316                     <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>"><?php printf( __( 'Add New %s' ), $tax->singular_label ); ?></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( sprintf( 'New %s Name', $tax->singular_label ) ); ?>" tabindex="3" aria-required="true"/>
    317                     <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>_parent"><?php printf( __('Parent %s'), $tax->singular_label ); ?>:</label><?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => sprintf( __('&mdash; Parent %s &mdash;'), $tax->singular_label ), 'tab_index' => 3 ) ); ?>
    318                     <input type="button" id="<?php echo $taxonomy; ?>-add-submit" class="add:<?php echo $taxonomy ?>checklist:<?php echo $taxonomy ?>-add button category-add-sumbit" value="<?php esc_attr_e( 'Add' ); ?>" tabindex="3" />
    319                     <?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce', false ); ?>
    320                     <span id="<?php echo $taxonomy; ?>-ajax-response"></span>
    321                 </p>
    322             </div>
    323         <?php endif; ?>
    324     </div>
    325     <?php
     312    <?php if ( current_user_can($tax->edit_cap) ) : ?>
     313            <div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children">
     314                <h4><a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js" tabindex="3"><?php printf( __( '+ Add New %s' ), $tax->singular_label ); ?></a></h4>
     315                <p id="<?php echo $taxonomy; ?>-add" class="category-add wp-hidden-child">
     316                    <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>"><?php printf( __( 'Add New %s' ), $tax->singular_label ); ?></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( sprintf( 'New %s Name', $tax->singular_label ) ); ?>" tabindex="3" aria-required="true"/>
     317                    <label class="screen-reader-text" for="new<?php echo $taxonomy; ?>_parent"><?php printf( __('Parent %s'), $tax->singular_label ); ?>:</label><?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => sprintf( __('&mdash; Parent %s &mdash;'), $tax->singular_label ), 'tab_index' => 3 ) ); ?>
     318                    <input type="button" id="<?php echo $taxonomy; ?>-add-submit" class="add:<?php echo $taxonomy ?>checklist:<?php echo $taxonomy ?>-add button category-add-sumbit" value="<?php esc_attr_e( 'Add' ); ?>" tabindex="3" />
     319                    <?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce', false ); ?>
     320                    <span id="<?php echo $taxonomy; ?>-ajax-response"></span>
     321                </p>
     322            </div>
     323        <?php endif; ?>
     324    </div>
     325    <?php
    326326}
    327327
Note: See TracChangeset for help on using the changeset viewer.