diff --git a/wp-admin/includes/class-wp-comments-list-table.php b/wp-admin/includes/class-wp-comments-list-table.php index da54905b72..f12565a95f 100644 --- a/wp-admin/includes/class-wp-comments-list-table.php +++ b/wp-admin/includes/class-wp-comments-list-table.php @@ -33,14 +33,14 @@ class WP_Comments_List_Table extends WP_List_Table { * * @see WP_List_Table::__construct() for more information on default arguments. * - * @global int|bool $post_id + * @global int $post_id * * @param array $args An associative array of arguments. */ public function __construct( $args = array() ) { global $post_id; - $post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : false; + $post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0; if ( get_option( 'show_avatars' ) ) { add_filter( 'comment_author', array( $this, 'floated_admin_avatar' ), 10, 2 ); @@ -69,7 +69,7 @@ class WP_Comments_List_Table extends WP_List_Table { /** * - * @global int|bool $post_id + * @global int $post_id * @global string $comment_status * @global string $search * @global string $comment_type @@ -192,7 +192,7 @@ class WP_Comments_List_Table extends WP_List_Table { /** * - * @global int|bool $post_id + * @global int $post_id * @global string $comment_status * @global string $comment_type */ @@ -383,7 +383,7 @@ class WP_Comments_List_Table extends WP_List_Table { /** * - * @global int|bool $post_id + * @global int $post_id * * @return array */ diff --git a/wp-includes/class-wp-comment-query.php b/wp-includes/class-wp-comment-query.php index df1bbaf2ef..4145d8fd76 100644 --- a/wp-includes/class-wp-comment-query.php +++ b/wp-includes/class-wp-comment-query.php @@ -214,7 +214,7 @@ class WP_Comment_Query { * Default empty. * @type int $post_ID Currently unused. * @type int $post_id Limit results to those affiliated with a given post ID. - * Default null. + * Default 0. * @type array $post__in Array of post IDs to include affiliated comments for. * Default empty. * @type array $post__not_in Array of post IDs to exclude affiliated comments for. @@ -278,7 +278,7 @@ class WP_Comment_Query { 'post_author__in' => '', 'post_author__not_in' => '', 'post_ID' => '', - 'post_id' => null, + 'post_id' => 0, 'post__in' => '', 'post__not_in' => '', 'post_author' => '', @@ -647,8 +647,9 @@ class WP_Comment_Query { $fields = "$wpdb->comments.comment_ID"; } - if ( strlen( $this->query_vars['post_id'] ) ) { - $this->sql_clauses['where']['post_id'] = $wpdb->prepare( 'comment_post_ID = %d', $this->query_vars['post_id'] ); + $post_id = absint( $this->query_vars['post_id'] ); + if ( ! empty( $post_id ) ) { + $this->sql_clauses['where']['post_id'] = $wpdb->prepare( 'comment_post_ID = %d', $post_id ); } // Parse comment IDs for an IN clause. diff --git a/wp-includes/version.php b/wp-includes/version.php index 18732eddd7..2acde723cf 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36479'; +$wp_version = '4.5-alpha-36480'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.