Changeset 9377
- Timestamp:
- 10/28/2008 07:17:29 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r9373 r9377 530 530 */ 531 531 function get_page_of_comment( $comment_ID, $per_page = null, $threaded = null ) { 532 if ( !$comment = get_comment( $comment_ID ) ) 532 $comment = get_comment( $comment_ID ); 533 534 if ( !$comment || 1 != $comment->comment_approved ) 533 535 return; 534 536 … … 536 538 return 1; 537 539 538 $comments = array_reverse( get_comments( $comment->comment_post_ID) );540 $comments = array_reverse( get_comments( array( 'post_id' => $comment->comment_post_ID ) ) ); 539 541 540 542 if ( null === $per_page ) … … 544 546 $threaded = get_option('thread_comments'); 545 547 546 // Find this comment's top level parent 547 if ( $threaded ) {548 while ( 0 != $comment->comment_parent ) 548 // Find this comment's top level parent if threading is enabled 549 if ( $threaded && 0 != $comment->comment_parent ) { 550 while ( 0 != $comment->comment_parent ) { 549 551 $comment = get_comment( $comment->comment_parent ); 552 if ( !$comment || 1 != $comment->comment_approved ) 553 return; 554 } 550 555 } 551 556
Note: See TracChangeset
for help on using the changeset viewer.