PluginProbe
User Access Manager / 2.3.19
User Access Manager v2.3.19
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
← All changes | src/Controller/Frontend/Content/PostController.php +6 -6 trunk2.3.19 View file →
@@ -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 /**