Use a switch. props jdub, see #13812.

git-svn-id: https://develop.svn.wordpress.org/trunk@15212 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-06-11 03:34:52 +00:00
parent 7a7a294de0
commit c4bda60979
1 changed files with 12 additions and 4 deletions

View File

@ -351,8 +351,10 @@ if ( ! function_exists( 'twentyten_comment' ) ) :
* @since Twenty Ten 1.0
*/
function twentyten_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment; ?>
<?php if ( '' == $comment->comment_type ) : ?>
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '' :
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<div id="comment-<?php comment_ID(); ?>">
<div class="comment-author vcard">
@ -378,10 +380,16 @@ function twentyten_comment( $comment, $args, $depth ) {
</div><!-- .reply -->
</div><!-- #comment-## -->
<?php elseif ( in_array($comment->comment_type, array('pingback', 'trackback')) ) : ?>
<?php
break;
case 'pingback' :
case 'trackback' :
?>
<li class="post pingback">
<p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'twentyten'), ' ' ); ?></p>
<?php endif;
<?php
break;
endswitch;
}
endif;