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

git-svn-id: http://core.svn.wordpress.org/trunk@23696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2013-03-14 16:36:14 +00:00
parent 6fde4c8c93
commit 29753503f5
4 changed files with 27 additions and 80 deletions

View File

@ -30,7 +30,14 @@ if ( post_password_required() )
</h2>
<ol class="comment-list">
<?php wp_list_comments( array( 'callback' => 'twentythirteen_comment', 'style' => 'ol' ) ); ?>
<?php
wp_list_comments( array(
'style' => 'ol',
'format' => 'html5',
'short_ping' => true,
'avatar_size' => 74,
) );
?>
</ol><!-- .comment-list -->
<?php

View File

@ -351,74 +351,6 @@ function twentythirteen_post_nav() {
}
endif;
if ( ! function_exists( 'twentythirteen_comment' ) ) :
/**
* Template for comments and pingbacks.
*
* To override this walker in a child theme without modifying the comments
* template simply create your own twentythirteen_comment(), and that function
* will be used instead.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*
* @since Twenty Thirteen 1.0
*
* @param object $comment Comment to display.
* @param array $args Optional args.
* @param int $depth Depth of comment.
* @return void
*/
function twentythirteen_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
// Display trackbacks differently than normal comments.
?>
<li id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
<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>
<?php
break;
default :
// Proceed with normal comments.
?>
<li id="li-comment-<?php comment_ID(); ?>">
<article id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
<div class="comment-author vcard">
<?php echo get_avatar( $comment, 74 ); ?>
<cite class="fn"><?php comment_author_link(); ?></cite>
</div><!-- .comment-author -->
<header class="comment-meta">
<?php
printf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
esc_url( get_comment_link( $comment->comment_ID ) ),
get_comment_time( 'c' ),
sprintf( _x( '%1$s at %2$s', '1: date, 2: time', 'twentythirteen' ), get_comment_date(), get_comment_time() )
);
edit_comment_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' );
?>
</header><!-- .comment-meta -->
<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentythirteen' ); ?></p>
<?php endif; ?>
<div class="comment-content">
<?php comment_text(); ?>
</div><!-- .comment-content -->
<div class="reply">
<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentythirteen' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div><!-- .reply -->
</article><!-- #comment-## -->
<?php
break;
endswitch; // End comment_type check.
}
endif;
if ( ! function_exists( 'twentythirteen_entry_meta' ) ) :
/**
* Prints HTML with meta information for current post: categories, tags, permalink, author, and date.

View File

@ -591,9 +591,10 @@ div.nav-menu > ul {
}
.comment-author {
float: right;
margin-left: 50px;
margin-right: auto;
left: auto;
right: 0;
}

View File

@ -510,7 +510,7 @@ hr {
.navigation:after,
.nav-links:after,
.gallery:after,
.comment:after {
.comment-body:after {
clear: both;
}
@ -530,8 +530,8 @@ hr {
.nav-links:after,
.gallery:before,
.gallery:after,
.comment:before,
.comment:after {
.comment-body:before,
.comment-body:after {
content: "";
display: table;
}
@ -2258,14 +2258,15 @@ footer.entry-meta {
display: none;
}
.comment {
.comment-body {
padding: 24px 0;
position: relative;
}
.comment-author {
float: left;
margin-right: 50px;
max-width: 74px;
position: absolute;
left: 0;
}
.comment-author .avatar {
@ -2274,16 +2275,21 @@ footer.entry-meta {
}
.comment-author .fn,
.comment-author .url,
.comment-reply-link {
color: #ed331c;
font-size: 14px;
font-style: normal;
}
.says {
display: none;
}
.no-avatars .comment-author {
float: none;
margin: 0 0 5px;
max-width: 100%;
position: relative;
}
.no-avatars .comment-meta,
@ -2329,6 +2335,7 @@ footer.entry-meta {
.comment-awaiting-moderation {
color: #a2a2a2;
margin: 20px 0 0;
}
.comment-awaiting-moderation:before {
@ -2349,8 +2356,8 @@ footer.entry-meta {
padding: 30px 0;
}
.comment + #respond {
margin-bottom: 30px;
.comment #respond {
margin-bottom: 20px;
padding: 20px;
}
@ -3117,9 +3124,9 @@ footer.entry-meta {
/* Comments */
.comment-author {
float: none;
margin: 0 0 5px;
max-width: 100%;
position: relative;
}
.comment-author .avatar {