[wp-trac] [WordPress Trac] #37392: Multisite "Sites" screen: Add links to filter websites by status

WordPress Trac noreply at wordpress.org
Wed Sep 18 21:30:31 UTC 2019


#37392: Multisite "Sites" screen: Add links to filter websites by status
----------------------------------------+------------------------
 Reporter:  thomaswm                    |       Owner:  mnelson4
     Type:  enhancement                 |      Status:  assigned
 Priority:  normal                      |   Milestone:  5.3
Component:  Networks and Sites          |     Version:  3.0
 Severity:  normal                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |     Focuses:  multisite
----------------------------------------+------------------------

Comment (by pbiron):

 The latest update to
 [https://core.trac.wordpress.org/attachment/ticket/37392/37392.9.patch
 37392.9.pacth] now applies cleanly.

 However, there seem to be a couple of unrelated problems with
 `wp_count_sites()` (that both result in the same problem):

 1. 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`

 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`

 The effect of the above is that the counts are all wrong!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/37392#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list