[wp-trac] [WordPress Trac] #26943: The comment_text() function retrieve the comment text 2 times

WordPress Trac noreply at wordpress.org
Sun Jan 26 12:16:27 UTC 2014


#26943: The comment_text() function retrieve the comment text 2 times
-------------------------+-----------------------------
 Reporter:  alexvorn2    |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Comments     |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 The '''comment_text()''' function loads two function that retrieves the
 comment, so I think It should retrieve only one...

 See the function here:

 {{{
 function comment_text( $comment_ID = 0, $args = array() ) {
         $comment = get_comment( $comment_ID );

         $comment_text = get_comment_text( $comment_ID , $args );

         echo apply_filters( 'comment_text', $comment_text, $comment, $args
 );
 }

 }}}

 what '''get_comment_text()''' does?:


 {{{
 function get_comment_text( $comment_ID = 0, $args = array() ) {
         $comment = get_comment( $comment_ID );

         return apply_filters( 'get_comment_text',
 $comment->comment_content, $comment, $args );
 }
 }}}

 So if you see the '''get_comment()''' is called twice...

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26943>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list