[wp-trac] [WordPress Trac] #20537: Don't spawn cron requests for suspended blogs

WordPress Trac noreply at wordpress.org
Mon Apr 18 04:31:22 UTC 2016


#20537: Don't spawn cron requests for suspended blogs
-------------------------------------------------+-------------------------
 Reporter:  ryan                                 |       Owner:  jrf
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.6
Component:  Cron API                             |     Version:  3.3.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch good-first-bug needs-      |     Focuses:  multisite
  testing                                        |
-------------------------------------------------+-------------------------

Comment (by jrf):

 Hi @jeremyfelt

 > Thanks for the patches, @jrf, this looks close.
 > * Let's use get_blog_details() instead of accessing the global
 $current_blog. See #22090.
 > * How about naming the filter skip_cron_for_site and not using the
 "blog" terminology here?
 > * Now that WP_Site is available, the filter docs should be adjusted to
 show that a WP_Site object is provided.


 Thanks for the feedback.

 I've adjusted the patch. Changes include:
 * Switched over to using `get_blog_details()` as per your suggestion. This
 does mean an extra level of nesting as the function is only available when
 on multi-site.
 * Renamed the filter. ''Some consistence in the naming here would be
 awesome,  `get_blog_details()` versus the use of `site` in the filter can
 lead to confusion.''
 * Adjusted the documentation to mention `WP_Site`.
 * Adjusted the documentation to make it extra clear when a site is
 regarded as suspended.
 * Updated the `@since` tag for the filter to `4.6.0`.

 Little side-note: I would expect `WP_Site->public` to be false (`0`) for
 suspended blogs, but it still shows as `1` (true).

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


More information about the wp-trac mailing list