Make WordPress Core

Changeset 34040


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

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

See #33638.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/dashboard.php

    r34038 r34040  
    630630?>
    631631
    632         <div id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ) ); ?>>
     632        <div id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ), $comment ); ?>>
    633633
    634634            <?php echo get_avatar( $comment, 50, 'mystery' ); ?>
  • 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.