[wp-trac] [WordPress Trac] #40201: Use get_site in clean_blog_cache

WordPress Trac noreply at wordpress.org
Fri Sep 29 08:48:54 UTC 2017


#40201: Use get_site in clean_blog_cache
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:  flixos90
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.9
Component:  Networks and Sites                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback needs-unit-   |     Focuses:  multisite
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by spacedmonkey):

 I updated the patch.
 [https://core.trac.wordpress.org/attachment/ticket/40201/40201.2.diff
 40201.2.diff]

 Refactor the logic a bit here.

 - Set default param to 0 on `clean_blog_cache`. This means you can call
 `clean_blog_cache()` and it will just clear the current site- which is
 useful.
 - Pass all input through `get_site`, which will cast, null, int, object
 and wp_site to wp_site. Making sure we are dealing with wp_site object
 going forward.

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


More information about the wp-trac mailing list