| @@ -465,12 +465,12 @@ | ||
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | private function getPostCountQuery(array $excludedPosts, string $type, string $perm): string |
| 468 | 468 | { |
| 469 | - $query = "SELECT `post_status`, COUNT(*) AS `num_posts` | |
| 470 | - FROM `{$this->database->getPostsTable()}` | |
| 471 | - WHERE `post_type` = %s | |
| 472 | - AND `ID` NOT IN ({$this->toIdList($excludedPosts)})"; | |
| 469 | + $query = "SELECT post_status, COUNT(*) AS num_posts | |
| 470 | + FROM {$this->database->getPostsTable()} | |
| 471 | + WHERE post_type = %s | |
| 472 | + AND ID NOT IN ({$this->toIdList($excludedPosts)})"; | |
| 473 | 473 | |
| 474 | 474 | if ('readable' === $perm |
| 475 | 475 | && $this->wordpress->isUserLoggedIn() === true |
| 476 | 476 | && $this->wordpress->currentUserCan( |
| @@ -477,14 +477,14 @@ | ||
| 477 | 477 | $this->wordpress->getPostTypeObject($type)->cap->read_private_posts |
| 478 | 478 | ) === false |
| 479 | 479 | ) { |
| 480 | 480 | $query .= $this->database->prepare( |
| 481 | - ' AND (`post_status` != \'private\' OR (`post_author` = %d AND `post_status` = \'private\'))', | |
| 481 | + ' AND (post_status != \'private\' OR (post_author = %d AND post_status = \'private\'))', | |
| 482 | 482 | $this->wordpress->getCurrentUser()->ID |
| 483 | 483 | ); |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | - $query .= ' GROUP BY `post_status`'; | |
| 486 | + $query .= ' GROUP BY post_status'; | |
| 487 | 487 | return $query; |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | /** |