WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #37392, comment 43


Ignore:
Timestamp:
09/18/2019 09:31:31 PM (2 months ago)
Author:
pbiron
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #37392, comment 43

    initial v1  
    551. in the `foreach` loop, `$_args[ $status ]` needs to be unset before the next iteration of the loop, otherwise the query for, e.g., `archived` becomes `public = 1 AND archived = 1`
    66
    7 2. even with #1 fixed, reusing the `WP_Site_Query()` object seems to cause problems.  Not sure if it's a bug in `WP_Site_Query::query()` or whether it's just not intended to be reused like that.  But `WP_Site_Query::$sql_clauses['where']` doesn't get reinitialized between repeated calls to `WP_Site_Query::query()`, which results in the query for `archive = 1` to actually be `public = 1 AND archived = 1`
     72. even with  number 1 fixed, reusing the `WP_Site_Query()` object seems to cause problems.  Not sure if it's a bug in `WP_Site_Query::query()` or whether it's just not intended to be reused like that.  But `WP_Site_Query::$sql_clauses['where']` doesn't get reinitialized between repeated calls to `WP_Site_Query::query()`, which results in the query for `archive = 1` to actually be `public = 1 AND archived = 1`
    88
    99The effect of the above is that the counts are all wrong!