From ef6f1354e9e83f584d22782a77ab46ed6bec099c Mon Sep 17 00:00:00 2001
From: Florian TIAR <contact@tiar-florian.fr>
Date: Tue, 27 Sep 2016 10:41:41 +0200
Subject: [PATCH] Comments : Fix incorect page number for comments due to parent arg
---
wp-includes/comment.php | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/wp-includes/comment.php b/wp-includes/comment.php
index 27524c5..a0d6e3c 100644
a
|
b
|
function get_page_of_comment( $comment_ID, $args = array() ) { |
902 | 902 | } |
903 | 903 | |
904 | 904 | if ( null === $page ) { |
| 905 | $parent = 0; |
905 | 906 | if ( '' === $args['max_depth'] ) { |
906 | | if ( get_option('thread_comments') ) |
| 907 | if ( get_option('thread_comments') ) { |
907 | 908 | $args['max_depth'] = get_option('thread_comments_depth'); |
908 | | else |
| 909 | } else { |
909 | 910 | $args['max_depth'] = -1; |
| 911 | $parent = ''; |
| 912 | } |
910 | 913 | } |
911 | 914 | |
912 | 915 | // Find this comment's top level parent if threading is enabled |
… |
… |
function get_page_of_comment( $comment_ID, $args = array() ) { |
919 | 922 | 'fields' => 'ids', |
920 | 923 | 'count' => true, |
921 | 924 | 'status' => 'approve', |
922 | | 'parent' => 0, |
| 925 | 'parent' => $parent, |
923 | 926 | 'date_query' => array( |
924 | 927 | array( |
925 | 928 | 'column' => "$wpdb->comments.comment_date_gmt", |