WordPress.org

Make WordPress Core

Ticket #13009: twentyten_comments.diff

File twentyten_comments.diff, 4.2 KB (added by ptahdunbar, 8 years ago)
  • themes/twentyten/functions.php

     
    243243}
    244244add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
    245245
    246 if ( ! function_exists( 'twentyten_comment' ) ) :
    247 /**
    248  * Template for comments and pingbacks.
    249  *
    250  * To override this walker in a child theme without modifying the comments template
    251  * simply create your own twentyten_comment(), and that function will be used instead.
    252  *
    253  * Used as a callback by wp_list_comments() for displaying the comments.
    254  *
    255  * @since 3.0.0
    256  */
    257 function twentyten_comment( $comment, $args, $depth ) {
    258         $GLOBALS ['comment'] = $comment; ?>
    259         <?php if ( '' == $comment->comment_type ) : ?>
    260         <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    261                 <div id="comment-<?php comment_ID(); ?>">
    262                 <div class="comment-author vcard">
    263                         <?php echo get_avatar( $comment, 40 ); ?>
    264                         <?php printf( __( '<cite class="fn">%s</cite> <span class="says">says:</span>', 'twentyten' ), get_comment_author_link() ); ?>
    265                 </div>
    266                 <?php if ( $comment->comment_approved == '0' ) : ?>
    267                         <em><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
    268                         <br />
    269                 <?php endif; ?>
    270 
    271                 <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(),  get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ),'  ','' ); ?></div>
    272 
    273                 <div class="comment-body"><?php comment_text(); ?></div>
    274 
    275                 <div class="reply">
    276                         <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    277                 </div>
    278         </div>
    279 
    280         <?php else : ?>
    281         <li class="post pingback">
    282                 <p><?php _e( 'Pingback: ', 'twentyten' ); ?><?php comment_author_link(); ?><?php edit_comment_link ( __('edit', 'twentyten'), '&nbsp;&nbsp;', '' ); ?></p>
    283         <?php endif;
    284 }
    285 endif;
    286 
    287246if ( ! function_exists( 'twentyten_cat_list' ) ) :
    288247/**
    289248 * Returns the list of categories
  • themes/twentyten/comments.php

     
    1111 * @subpackage Twenty Ten
    1212 * @since 3.0.0
    1313 */
     14
     15if ( ! function_exists( 'twentyten_comment' ) ) :
     16/**
     17 * Template for comments and pingbacks.
     18 *
     19 * To override this walker in a child theme without modifying the comments template
     20 * simply create your own twentyten_comment(), and that function will be used instead.
     21 *
     22 * Used as a callback by wp_list_comments() for displaying the comments.
     23 *
     24 * @since 3.0.0
     25 */
     26function twentyten_comment( $comment, $args, $depth ) {
     27        $GLOBALS ['comment'] = $comment; ?>
     28        <?php if ( '' == $comment->comment_type ) : ?>
     29        <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
     30                <div id="comment-<?php comment_ID(); ?>">
     31                <div class="comment-author vcard">
     32                        <?php echo get_avatar( $comment, 40 ); ?>
     33                        <?php printf( __( '<cite class="fn">%s</cite> <span class="says">says:</span>', 'twentyten' ), get_comment_author_link() ); ?>
     34                </div>
     35                <?php if ( $comment->comment_approved == '0' ) : ?>
     36                        <em><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
     37                        <br />
     38                <?php endif; ?>
     39
     40                <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(),  get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ),'  ','' ); ?></div>
     41
     42                <div class="comment-body"><?php comment_text(); ?></div>
     43
     44                <div class="reply">
     45                        <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
     46                </div>
     47        </div>
     48
     49        <?php else : ?>
     50        <li class="post pingback">
     51                <p><?php _e( 'Pingback: ', 'twentyten' ); ?><?php comment_author_link(); ?><?php edit_comment_link ( __('edit', 'twentyten'), '&nbsp;&nbsp;', '' ); ?></p>
     52        <?php endif;
     53}
     54endif;
     55
    1456?>
    1557
    1658                        <div id="comments">