Ticket #14856: comment_text args param.diff
| File comment_text args param.diff, 2.1 KB (added by simonwheatley, 3 years ago) |
|---|
-
wp-includes/comment-template.php
593 593 * @uses $comment 594 594 * 595 595 * @param int $comment_ID The ID of the comment for which to get the text. Optional. 596 * @param array $args Formatting options passed into, for example, wp_list_comments. Optional. 596 597 * @return string The comment content 597 598 */ 598 function get_comment_text( $comment_ID = 0 ) {599 function get_comment_text( $comment_ID = 0, $args = null ) { 599 600 $comment = get_comment( $comment_ID ); 600 return apply_filters('get_comment_text', $comment->comment_content );601 return apply_filters('get_comment_text', $comment->comment_content, $comment->comment_ID, $args); 601 602 } 602 603 603 604 /** … … 609 610 * 610 611 * @param int $comment_ID The ID of the comment for which to print the text. Optional. 611 612 */ 612 function comment_text( $comment_ID = 0 ) { 613 echo apply_filters('comment_text', get_comment_text() ); 613 function comment_text( $comment_ID = 0, $args = null ) { 614 if ( ! $comment_ID ) 615 $comment_ID = get_comment_ID(); 616 echo apply_filters('comment_text', get_comment_text( $comment_ID, $args ), $comment_ID, $args ); 614 617 } 615 618 616 619 /** … … 1322 1325 * @param string $output Passed by reference. Used to append additional content. 1323 1326 * @param object $comment Comment data object. 1324 1327 * @param int $depth Depth of comment in reference to parents. 1328 * @param array $args Formatting options 1325 1329 * @param array $args 1326 1330 */ 1327 1331 function start_el(&$output, $comment, $depth, $args) { … … 1364 1368 ?> 1365 1369 </div> 1366 1370 1367 <?php comment_text( ) ?>1371 <?php comment_text( null, array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'])) ) ?> 1368 1372 1369 1373 <div class="reply"> 1370 <?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>1374 <?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?> 1371 1375 </div> 1372 1376 <?php if ( 'div' != $args['style'] ) : ?> 1373 1377 </div>