Make WordPress Core


Ignore:
Timestamp:
03/14/2013 04:36:14 PM (12 years ago)
Author:
lancewillett
Message:

Twenty Thirteen: remove custom comment callback in favor of core comment_form() defaults. Props obenland, closes #22005. See #20088.

File:
1 edited

Legend:

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

    r23680 r23696  
    352352endif;
    353353
    354 if ( ! function_exists( 'twentythirteen_comment' ) ) :
    355 /**
    356  * Template for comments and pingbacks.
    357  *
    358  * To override this walker in a child theme without modifying the comments
    359  * template simply create your own twentythirteen_comment(), and that function
    360  * will be used instead.
    361  *
    362  * Used as a callback by wp_list_comments() for displaying the comments.
    363  *
    364  * @since Twenty Thirteen 1.0
    365  *
    366  * @param object $comment Comment to display.
    367  * @param array $args Optional args.
    368  * @param int $depth Depth of comment.
    369  * @return void
    370  */
    371 
    372 function twentythirteen_comment( $comment, $args, $depth ) {
    373     $GLOBALS['comment'] = $comment;
    374     switch ( $comment->comment_type ) :
    375         case 'pingback' :
    376         case 'trackback' :
    377         // Display trackbacks differently than normal comments.
    378     ?>
    379     <li id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
    380         <p><?php _e( 'Pingback:', 'twentythirteen' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( 'Edit', 'twentythirteen' ), '<span class="ping-meta"><span class="edit-link">', '</span></span>' ); ?></p>
    381     <?php
    382             break;
    383         default :
    384         // Proceed with normal comments.
    385     ?>
    386     <li id="li-comment-<?php comment_ID(); ?>">
    387         <article id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
    388             <div class="comment-author vcard">
    389                 <?php echo get_avatar( $comment, 74 ); ?>
    390                 <cite class="fn"><?php comment_author_link(); ?></cite>
    391             </div><!-- .comment-author -->
    392 
    393             <header class="comment-meta">
    394                 <?php
    395                     printf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
    396                         esc_url( get_comment_link( $comment->comment_ID ) ),
    397                         get_comment_time( 'c' ),
    398                         sprintf( _x( '%1$s at %2$s', '1: date, 2: time', 'twentythirteen' ), get_comment_date(), get_comment_time() )
    399                     );
    400                     edit_comment_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' );
    401                 ?>
    402             </header><!-- .comment-meta -->
    403 
    404             <?php if ( '0' == $comment->comment_approved ) : ?>
    405                 <p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentythirteen' ); ?></p>
    406             <?php endif; ?>
    407 
    408             <div class="comment-content">
    409                 <?php comment_text(); ?>
    410             </div><!-- .comment-content -->
    411 
    412             <div class="reply">
    413                 <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentythirteen' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    414             </div><!-- .reply -->
    415         </article><!-- #comment-## -->
    416     <?php
    417         break;
    418     endswitch; // End comment_type check.
    419 }
    420 endif;
    421 
    422354if ( ! function_exists( 'twentythirteen_entry_meta' ) ) :
    423355/**
Note: See TracChangeset for help on using the changeset viewer.