Skip to content

Commit

Permalink
Use 'publish' post_status when querying posts for Stats endpoint.
Browse files Browse the repository at this point in the history
Previously, the post_status logic was: if the default "draft" post
status is something other than "draft", use that. Otherwise, use
"publish". This must be an error, since it implies that using a non-
default draft status means that you only want to count drafts in
your stats. Instead, we always want to count published posts only.

See #933.
  • Loading branch information
boonebgorges committed Mar 4, 2024
1 parent 6f822bc commit a6cf7e7
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Controllers/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,7 @@ private function meta_query_args() {
* @return string
*/
private function post_status_query_args() {
$status = get_option( PF_SLUG . '_draft_post_status', 'draft' );
if ( 'draft' !== $status ) {
$status_check = $status;
} else {
$status_check = 'publish';
}
return $status_check;
return 'publish';
}

/**
Expand Down

0 comments on commit a6cf7e7

Please sign in to comment.