Skip to content

Commit c97aa78

Browse files
committed
Cast results to array
1 parent e351f6f commit c97aa78

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wp-includes/comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2875,7 +2875,7 @@ function wp_update_comment_count_now( $post_id ) {
28752875
$new = apply_filters( 'pre_wp_update_comment_count_now', null, $old, $post_id );
28762876

28772877
if ( is_null( $new ) ) {
2878-
$comments = $wpdb->get_results( $wpdb->prepare( "SELECT comment_ID, comment_parent, comment_approved FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_type != 'note'", $post_id ) );
2878+
$comments = (array) $wpdb->get_results( $wpdb->prepare( "SELECT comment_ID, comment_parent, comment_approved FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_type != 'note'", $post_id ) );
28792879
$comments_by_id = array();
28802880

28812881
// Create a lookup array by comment ID.

0 commit comments

Comments
 (0)