Ignore the 'comment_order' setting when determining comment pagination.

[38740] incorrectly introduced logic that changed a comment's page when
'comment_order' was set to 'desc'. This is in violation of the design
of the comment pagination system: a comment's page is designed not to
change when 'comment_order' or 'default_comment_page' are changed.
See #31101.

Merges [39663] to the 4.7 branch.

Props rachelbaker.
Fixes #39280.

Built from https://develop.svn.wordpress.org/branches/4.7@39664


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2017-01-02 20:08:23 +00:00
parent b410db797b
commit 6124fbb02c
2 changed files with 2 additions and 8 deletions

View File

@ -1003,12 +1003,6 @@ function get_page_of_comment( $comment_ID, $args = array() ) {
if ( $args['max_depth'] > 1 && 0 != $comment->comment_parent ) if ( $args['max_depth'] > 1 && 0 != $comment->comment_parent )
return get_page_of_comment( $comment->comment_parent, $args ); return get_page_of_comment( $comment->comment_parent, $args );
if ( 'desc' === get_option( 'comment_order' ) ) {
$compare = 'after';
} else {
$compare = 'before';
}
$comment_args = array( $comment_args = array(
'type' => $args['type'], 'type' => $args['type'],
'post_id' => $comment->comment_post_ID, 'post_id' => $comment->comment_post_ID,
@ -1019,7 +1013,7 @@ function get_page_of_comment( $comment_ID, $args = array() ) {
'date_query' => array( 'date_query' => array(
array( array(
'column' => "$wpdb->comments.comment_date_gmt", 'column' => "$wpdb->comments.comment_date_gmt",
$compare => $comment->comment_date_gmt, 'before' => $comment->comment_date_gmt,
) )
), ),
); );

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.7.1-alpha-39661'; $wp_version = '4.7.1-alpha-39664';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.