Skip to content

Commit

Permalink
Add comments to posts with post_status=(publish, private) and comment…
Browse files Browse the repository at this point in the history
…_status=open only.
  • Loading branch information
kagg-design committed Mar 11, 2024
1 parent bbc1b05 commit 9ba8558
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/php/Generator/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ private function prepare_posts(): array {
"SELECT p.ID, post_date, post_date_gmt
FROM $wpdb->posts AS p
INNER JOIN
(SELECT ID FROM $wpdb->posts WHERE post_type = 'post' ORDER BY RAND() LIMIT %d) AS t
(SELECT ID FROM $wpdb->posts
WHERE post_type = 'post' AND post_status IN ('publish', 'private') AND comment_status = 'open'
ORDER BY RAND() LIMIT %d) AS t
ON p.ID = t.ID;",
$this->random_posts_count
)
Expand Down

0 comments on commit 9ba8558

Please sign in to comment.