Skip to content

Commit 846b801

Browse files
committed
fix: always return array
1 parent ea5d314 commit 846b801

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Comment_Command.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ static function ( $id ) use ( $exclude_list ) {
791791
/**
792792
* Gets all available comment IDs.
793793
*/
794-
private function get_all_comment_ids(): array|int {
794+
private function get_all_comment_ids(): array {
795795
$query = new WP_Comment_Query();
796796
$comments = $query->query(
797797
array(
@@ -800,6 +800,10 @@ private function get_all_comment_ids(): array|int {
800800
)
801801
);
802802

803+
if (!is_array($comments)) {
804+
return [];
805+
}
806+
803807
return $comments;
804808
}
805809
}

0 commit comments

Comments
 (0)