WordPress.org

Make WordPress Core

Changeset 23696


Ignore:
Timestamp:
03/14/13 16:36:14 (2 years ago)
Author:
lancewillett
Message:

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

Location:
trunk/wp-content/themes/twentythirteen
Files:
4 edited

Legend:

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

    r23690 r23696  
    3131 
    3232        <ol class="comment-list"> 
    33             <?php wp_list_comments( array( 'callback' => 'twentythirteen_comment', 'style' => 'ol' ) ); ?> 
     33            <?php 
     34                wp_list_comments( array( 
     35                    'style'       => 'ol', 
     36                    'format'      => 'html5', 
     37                    'short_ping'  => true, 
     38                    'avatar_size' => 74, 
     39                ) ); 
     40            ?> 
    3441        </ol><!-- .comment-list --> 
    3542 
  • 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/** 
  • trunk/wp-content/themes/twentythirteen/rtl.css

    r23690 r23696  
    592592 
    593593.comment-author { 
    594     float: right; 
    595594    margin-left: 50px; 
    596595    margin-right: auto; 
     596    left: auto; 
     597    right: 0; 
    597598} 
    598599 
  • trunk/wp-content/themes/twentythirteen/style.css

    r23690 r23696  
    511511.nav-links:after, 
    512512.gallery:after, 
    513 .comment:after { 
     513.comment-body:after { 
    514514    clear: both; 
    515515} 
     
    531531.gallery:before, 
    532532.gallery:after, 
    533 .comment:before, 
    534 .comment:after { 
     533.comment-body:before, 
     534.comment-body:after { 
    535535    content: ""; 
    536536    display: table; 
     
    22592259} 
    22602260 
    2261 .comment { 
     2261.comment-body { 
    22622262    padding: 24px 0; 
     2263    position: relative; 
    22632264} 
    22642265 
    22652266.comment-author { 
    2266     float: left; 
    2267     margin-right: 50px; 
    22682267    max-width: 74px; 
     2268    position: absolute; 
     2269    left: 0; 
    22692270} 
    22702271 
     
    22752276 
    22762277.comment-author .fn, 
     2278.comment-author .url, 
    22772279.comment-reply-link { 
    22782280    color: #ed331c; 
     
    22812283} 
    22822284 
     2285.says { 
     2286    display: none; 
     2287} 
     2288 
    22832289.no-avatars .comment-author { 
    2284     float: none; 
    22852290    margin: 0 0 5px; 
    22862291    max-width: 100%; 
     2292    position: relative; 
    22872293} 
    22882294 
     
    23302336.comment-awaiting-moderation { 
    23312337    color: #a2a2a2; 
     2338    margin: 20px 0 0; 
    23322339} 
    23332340 
     
    23502357} 
    23512358 
    2352 .comment + #respond { 
    2353     margin-bottom: 30px; 
     2359.comment #respond { 
     2360    margin-bottom: 20px; 
    23542361    padding: 20px; 
    23552362} 
     
    31183125    /* Comments */ 
    31193126    .comment-author { 
    3120         float: none; 
    31213127        margin: 0 0 5px; 
    31223128        max-width: 100%; 
     3129        position: relative; 
    31233130    } 
    31243131 
Note: See TracChangeset for help on using the changeset viewer.