Make WordPress Core

Changeset 15212


Ignore:
Timestamp:
06/11/2010 03:34:52 AM (14 years ago)
Author:
nacin
Message:

Use a switch. props jdub, see #13812.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/functions.php

    r15209 r15212  
    352352 */
    353353function twentyten_comment( $comment, $args, $depth ) {
    354     $GLOBALS['comment'] = $comment; ?>
    355     <?php if ( '' == $comment->comment_type ) : ?>
     354    $GLOBALS['comment'] = $comment;
     355    switch ( $comment->comment_type ) :
     356        case '' :
     357    ?>
    356358    <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    357359        <div id="comment-<?php comment_ID(); ?>">
     
    379381    </div><!-- #comment-##  -->
    380382
    381     <?php elseif ( in_array($comment->comment_type, array('pingback', 'trackback')) ) : ?>
     383    <?php
     384            break;
     385        case 'pingback'  :
     386        case 'trackback' :
     387    ?>
    382388    <li class="post pingback">
    383389        <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'twentyten'), ' ' ); ?></p>
    384     <?php endif;
     390    <?php
     391            break;
     392    endswitch;
    385393}
    386394endif;
Note: See TracChangeset for help on using the changeset viewer.