Changeset 25555
- Timestamp:
- 09/21/2013 06:17:22 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r25494 r25555 592 592 * 593 593 * @since 1.5.0 594 * @uses $comment 595 * 596 * @param int $comment_ID The ID of the comment for which to get the text. Optional. 597 * @return string The comment content 598 */ 599 function get_comment_text( $comment_ID = 0 ) { 594 * 595 * @param int $comment_ID Optional. The ID of the comment for which to get the text. 596 * Default 0. 597 * @param array $args Optional. An array of arguments. @see Walker_Comment::comment() 598 * Default empty array. 599 * @return string The comment content. 600 */ 601 function get_comment_text( $comment_ID = 0, $args = array() ) { 600 602 $comment = get_comment( $comment_ID ); 601 return apply_filters( 'get_comment_text', $comment->comment_content, $comment ); 602 } 603 604 /** 605 * Displays the text of the current comment. 603 604 /** 605 * Filter the text of a comment. 606 * 607 * @since 1.5.2 608 * 609 * @param string $comment->comment_content The text of the comment. 610 * @param object $comment The comment object. 611 * @param array $args An array of arguments. @see Walker_Comment::comment() 612 */ 613 return apply_filters( 'get_comment_text', $comment->comment_content, $comment, $args ); 614 } 615 616 /** 617 * Display the text of the current comment. 606 618 * 607 619 * @since 0.71 608 * @uses apply_filters() Passes the comment content through the 'comment_text' hook before display 609 * @uses get_comment_text() Gets the comment content 610 * 611 * @param int $comment_ID The ID of the comment for which to print the text. Optional. 612 */ 613 function comment_text( $comment_ID = 0 ) { 620 * 621 * @param int $comment_ID Optional. The ID of the comment for which to print the text. 622 * Default 0. 623 * @param array $args Optional. An array of arguments. @see Walker_Comment::comment() 624 * Default empty array. 625 */ 626 function comment_text( $comment_ID = 0, $args = array() ) { 614 627 $comment = get_comment( $comment_ID ); 615 echo apply_filters( 'comment_text', get_comment_text( $comment_ID ), $comment ); 628 629 $comment_text = get_comment_text( $comment_ID , $args ); 630 /** 631 * Filter the text of a comment to be displayed. 632 * 633 * @since 1.2.1 634 * 635 * @param string $comment_text The text of the current comment. 636 * @param object $comment The comment object. 637 * @param array $args An array of arguments. @see Walker_Comment::comment() 638 */ 639 echo apply_filters( 'comment_text', $comment_text, $comment, $args ); 616 640 } 617 641 … … 1453 1477 </div> 1454 1478 1455 <?php comment_text( )?>1479 <?php comment_text( get_comment_id(), array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> 1456 1480 1457 1481 <div class="reply">
Note: See TracChangeset
for help on using the changeset viewer.