forked from mirror/_s
_s: Update comment markup to make it forward compatible with html5
comments in 3.6. As a result the custom callback can be safely removed in the future. Also closes #220.
This commit is contained in:
parent
9bc326be66
commit
95c3bd62cf
|
@ -63,51 +63,49 @@ if ( ! function_exists( '_s_comment' ) ) :
|
||||||
*/
|
*/
|
||||||
function _s_comment( $comment, $args, $depth ) {
|
function _s_comment( $comment, $args, $depth ) {
|
||||||
$GLOBALS['comment'] = $comment;
|
$GLOBALS['comment'] = $comment;
|
||||||
switch ( $comment->comment_type ) :
|
|
||||||
case 'pingback' :
|
if ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) : ?>
|
||||||
case 'trackback' :
|
|
||||||
?>
|
<li id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
|
||||||
<li class="post pingback">
|
<div class="comment-body">
|
||||||
<p><?php _e( 'Pingback:', '_s' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', '_s' ), '<span class="edit-link">', '<span>' ); ?></p>
|
<?php _e( 'Pingback:', '_s' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
|
||||||
<?php
|
</div>
|
||||||
break;
|
|
||||||
default :
|
<?php else : ?>
|
||||||
?>
|
|
||||||
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
|
<li id="comment-<?php comment_ID(); ?>" <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?>>
|
||||||
<article id="comment-<?php comment_ID(); ?>" class="comment">
|
<article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
|
||||||
<footer>
|
<footer class="comment-meta">
|
||||||
<div class="comment-author vcard">
|
<div class="comment-author vcard">
|
||||||
<?php echo get_avatar( $comment, 40 ); ?>
|
<?php if ( 0 != $args['avatar_size'] ) echo get_avatar( $comment, $args['avatar_size'] ); ?>
|
||||||
<?php printf( __( '%s <span class="says">says:</span>', '_s' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
|
<?php printf( __( '%s <span class="says">says:</span>', '_s' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
|
||||||
</div><!-- .comment-author .vcard -->
|
</div><!-- .comment-author -->
|
||||||
<?php if ( $comment->comment_approved == '0' ) : ?>
|
|
||||||
<em><?php _e( 'Your comment is awaiting moderation.', '_s' ); ?></em>
|
<div class="comment-metadata">
|
||||||
<br />
|
<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
|
||||||
|
<time datetime="<?php comment_time( 'c' ); ?>">
|
||||||
|
<?php printf( _x( '%1$s at %2$s', '1: date, 2: time', '_s' ), get_comment_date(), get_comment_time() ); ?>
|
||||||
|
</time>
|
||||||
|
</a>
|
||||||
|
<?php edit_comment_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
|
||||||
|
</div><!-- .comment-metadata -->
|
||||||
|
|
||||||
|
<?php if ( '0' == $comment->comment_approved ) : ?>
|
||||||
|
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', '_s' ); ?></p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
</footer><!-- .comment-meta -->
|
||||||
|
|
||||||
<div class="comment-meta commentmetadata">
|
<div class="comment-content">
|
||||||
<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><time datetime="<?php comment_time( 'c' ); ?>">
|
<?php comment_text(); ?>
|
||||||
<?php printf( _x( '%1$s at %2$s', '1: date, 2: time', '_s' ), get_comment_date(), get_comment_time() ); ?>
|
</div><!-- .comment-content -->
|
||||||
</time></a>
|
|
||||||
<?php edit_comment_link( __( 'Edit', '_s' ), '<span class="edit-link">', '<span>' ); ?>
|
|
||||||
</div><!-- .comment-meta .commentmetadata -->
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<div class="comment-content"><?php comment_text(); ?></div>
|
|
||||||
|
|
||||||
<div class="reply">
|
<div class="reply">
|
||||||
<?php
|
<?php comment_reply_link( array_merge( $args, array( 'add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
|
||||||
comment_reply_link( array_merge( $args,array(
|
|
||||||
'depth' => $depth,
|
|
||||||
'max_depth' => $args['max_depth'],
|
|
||||||
) ) );
|
|
||||||
?>
|
|
||||||
</div><!-- .reply -->
|
</div><!-- .reply -->
|
||||||
</article><!-- #comment-## -->
|
</article><!-- .comment-body -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
break;
|
endif;
|
||||||
endswitch;
|
|
||||||
}
|
}
|
||||||
endif; // ends check for _s_comment()
|
endif; // ends check for _s_comment()
|
||||||
|
|
||||||
|
|
Reference in New Issue