Use a switch. props jdub, see #13812.

git-svn-id: http://svn.automattic.com/wordpress/trunk@15212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-06-11 03:34:52 +00:00
parent 8fcdf9a979
commit 4e15eaa830
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;