After [33961], pass `$comment` to `comment_class()` where possible to avoid extra cache/db lookups.

See #33638.

Built from https://develop.svn.wordpress.org/trunk@34040


git-svn-id: http://core.svn.wordpress.org/trunk@34008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-11 06:12:24 +00:00
parent fc328f5484
commit 58c3c30e8d
3 changed files with 5 additions and 5 deletions

View File

@ -629,7 +629,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
?> ?>
<div id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ) ); ?>> <div id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ), $comment ); ?>>
<?php echo get_avatar( $comment, 50, 'mystery' ); ?> <?php echo get_avatar( $comment, 50, 'mystery' ); ?>

View File

@ -227,7 +227,7 @@ class Walker_Comment extends Walker {
protected function ping( $comment, $depth, $args ) { protected function ping( $comment, $depth, $args ) {
$tag = ( 'div' == $args['style'] ) ? 'div' : 'li'; $tag = ( 'div' == $args['style'] ) ? 'div' : 'li';
?> ?>
<<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>> <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( '', $comment ); ?>>
<div class="comment-body"> <div class="comment-body">
<?php _e( 'Pingback:' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( 'Edit' ), '<span class="edit-link">', '</span>' ); ?> <?php _e( 'Pingback:' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( 'Edit' ), '<span class="edit-link">', '</span>' ); ?>
</div> </div>
@ -255,7 +255,7 @@ class Walker_Comment extends Walker {
$add_below = 'div-comment'; $add_below = 'div-comment';
} }
?> ?>
<<?php echo $tag; ?> <?php comment_class( $this->has_children ? 'parent' : '' ); ?> id="comment-<?php comment_ID(); ?>"> <<?php echo $tag; ?> <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?> id="comment-<?php comment_ID(); ?>">
<?php if ( 'div' != $args['style'] ) : ?> <?php if ( 'div' != $args['style'] ) : ?>
<div id="div-comment-<?php comment_ID(); ?>" class="comment-body"> <div id="div-comment-<?php comment_ID(); ?>" class="comment-body">
<?php endif; ?> <?php endif; ?>
@ -308,7 +308,7 @@ class Walker_Comment extends Walker {
protected function html5_comment( $comment, $depth, $args ) { protected function html5_comment( $comment, $depth, $args ) {
$tag = ( 'div' === $args['style'] ) ? 'div' : 'li'; $tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
?> ?>
<<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '' ); ?>> <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>
<article id="div-comment-<?php comment_ID(); ?>" class="comment-body"> <article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
<footer class="comment-meta"> <footer class="comment-meta">
<div class="comment-author vcard"> <div class="comment-author vcard">

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-34039'; $wp_version = '4.4-alpha-34040';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.