Make WordPress Core


Ignore:
Timestamp:
09/11/2015 06:11:35 AM (11 years ago)
Author:
wonderboymusic
Message:

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

See #33638.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-walker-comment.php

    r34039 r34040  
    228228                $tag = ( 'div' == $args['style'] ) ? 'div' : 'li';
    229229?>
    230                 <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
     230                <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( '', $comment ); ?>>
    231231                        <div class="comment-body">
    232232                                <?php _e( 'Pingback:' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( 'Edit' ), '<span class="edit-link">', '</span>' ); ?>
     
    256256                }
    257257?>
    258                 <<?php echo $tag; ?> <?php comment_class( $this->has_children ? 'parent' : '' ); ?> id="comment-<?php comment_ID(); ?>">
     258                <<?php echo $tag; ?> <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?> id="comment-<?php comment_ID(); ?>">
    259259                <?php if ( 'div' != $args['style'] ) : ?>
    260260                <div id="div-comment-<?php comment_ID(); ?>" class="comment-body">
     
    309309                $tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
    310310?>
    311                 <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '' ); ?>>
     311                <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>
    312312                        <article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
    313313                                <footer class="comment-meta">
Note: See TracChangeset for help on using the changeset viewer.