~canonical-sysadmins/wordpress/4.8.2

« back to all changes in this revision

Viewing changes to wp-includes/comment.php

  • Committer: Jamon Camisso
  • Date: 2017-01-12 15:31:31 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: jamon.camisso@canonical.com-20170112153131-yfjnoh8x21u7flat
Merge WP4.7.1 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1003
1003
                if ( $args['max_depth'] > 1 && 0 != $comment->comment_parent )
1004
1004
                        return get_page_of_comment( $comment->comment_parent, $args );
1005
1005
 
1006
 
                if ( 'desc' === get_option( 'comment_order' ) ) {
1007
 
                        $compare = 'after';
1008
 
                } else {
1009
 
                        $compare = 'before';
1010
 
                }
1011
 
 
1012
1006
                $comment_args = array(
1013
1007
                        'type'       => $args['type'],
1014
1008
                        'post_id'    => $comment->comment_post_ID,
1019
1013
                        'date_query' => array(
1020
1014
                                array(
1021
1015
                                        'column' => "$wpdb->comments.comment_date_gmt",
1022
 
                                        $compare => $comment->comment_date_gmt,
 
1016
                                        'before' => $comment->comment_date_gmt,
1023
1017
                                )
1024
1018
                        ),
1025
1019
                );
2186
2180
 
2187
2181
        $comment_ID = $data['comment_ID'];
2188
2182
        $comment_post_ID = $data['comment_post_ID'];
2189
 
        $keys = array( 'comment_post_ID', 'comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt', 'comment_type', 'comment_parent', 'user_id', 'comment_agent', 'comment_author_IP' );
2190
 
        $data = wp_array_slice_assoc( $data, $keys );
2191
2183
 
2192
2184
        /**
2193
2185
         * Filters the comment data immediately before it is updated in the database.
2202
2194
         */
2203
2195
        $data = apply_filters( 'wp_update_comment_data', $data, $comment, $commentarr );
2204
2196
 
 
2197
        $keys = array( 'comment_post_ID', 'comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt', 'comment_type', 'comment_parent', 'user_id', 'comment_agent', 'comment_author_IP' );
 
2198
        $data = wp_array_slice_assoc( $data, $keys );
 
2199
 
2205
2200
        $rval = $wpdb->update( $wpdb->comments, $data, compact( 'comment_ID' ) );
2206
2201
 
2207
2202
        clean_comment_cache( $comment_ID );