Ticket #7956: 7956_while_fix.patch
File 7956_while_fix.patch, 1.1 KB (added by , 17 years ago) |
---|
-
wp-includes/comment.php
529 529 * @return int|null Comment page number or null on error. 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 535 537 if ( !get_option('page_comments') ) … … 543 545 if ( null === $threaded ) 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 552 557 // Start going through the comments until we find what page number the above top level comment is on