WordPress.org

Make WordPress Core

Ticket #14856: 14856.2.diff

File 14856.2.diff, 2.1 KB (added by DrewAPicture, 2 years ago)
  • wp-includes/comment-template.php

     
    590590 * Retrieve the text of the current comment. 
    591591 * 
    592592 * @since 1.5.0 
     593 * 
    593594 * @uses $comment 
    594595 * 
    595  * @param int $comment_ID The ID of the comment for which to get the text. Optional. 
     596 * @param int $comment_ID (optional) The ID of the comment for which to get the text. 
     597 * @param array $args (optional) An array of arguments. 
    596598 * @return string The comment content 
    597599 */ 
    598 function get_comment_text( $comment_ID = 0 ) { 
     600function get_comment_text( $comment_ID = 0, $args = array() ) { 
    599601        $comment = get_comment( $comment_ID ); 
    600         return apply_filters( 'get_comment_text', $comment->comment_content, $comment ); 
     602        return apply_filters( 'get_comment_text', $comment->comment_content, $comment, $args ); 
    601603} 
    602604 
    603605/** 
    604606 * Displays the text of the current comment. 
    605607 * 
    606608 * @since 0.71 
     609 * 
    607610 * @uses apply_filters() Passes the comment content through the 'comment_text' hook before display 
    608611 * @uses get_comment_text() Gets the comment content 
    609612 * 
    610  * @param int $comment_ID The ID of the comment for which to print the text. Optional. 
     613 * @param int $comment_ID (optional) The ID of the comment for which to print the text. 
     614 * @param array $args (optional) An array of arguments. See Walker_Comment->comment(). 
    611615 */ 
    612 function comment_text( $comment_ID = 0 ) { 
     616function comment_text( $comment_ID = 0, $args = array() ) { 
    613617        $comment = get_comment( $comment_ID ); 
    614         echo apply_filters( 'comment_text', get_comment_text( $comment_ID ), $comment ); 
     618        echo apply_filters( 'comment_text', get_comment_text( $comment_ID , $args ), $comment, $args ); 
    615619} 
    616620 
    617621/** 
     
    14191423                        ?> 
    14201424                </div> 
    14211425 
    1422                 <?php comment_text() ?> 
     1426                <?php comment_text( get_comment_id(), array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> 
    14231427 
    14241428                <div class="reply"> 
    14251429                        <?php comment_reply_link( array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>