Ticket #20537: 20537.2.diff
File 20537.2.diff, 2.0 KB (added by , 9 years ago) |
---|
-
src/wp-cron.php
58 58 if ( false === $crons = _get_cron_array() ) 59 59 die(); 60 60 61 $spawn_cron = true; 62 $current_site = null; 63 if ( is_multisite() ) { 64 $current_site = get_blog_details(); 65 // Don't process cron for suspended blogs. 66 if ( $current_site->archived || $current_site->spam || $current_site->deleted ) { 67 $spawn_cron = false; 68 } 69 } 70 /** This filter is documented in wp-includes/cron.php */ 71 if ( true === apply_filters( 'spawn_cron_for_site', $spawn_cron, $current_site ) ) { 72 die(); 73 } 74 unset( $spawn_cron, $current_site ); 75 61 76 $keys = array_keys( $crons ); 62 77 $gmt_time = microtime( true ); 63 78 -
src/wp-includes/cron.php
342 342 if ( false === $crons = _get_cron_array() ) 343 343 return; 344 344 345 $spawn_cron = true; 346 $current_site = null; 347 if ( is_multisite() ) { 348 $current_site = get_blog_details(); 349 // Don't process cron for suspended sites. 350 if ( $current_site->archived || $current_site->spam || $current_site->deleted ) { 351 $spawn_cron = false; 352 } 353 } 354 /** 355 * Filter whether to spawn cron for a site. 356 * 357 * @since 4.6.0 358 * 359 * @param bool $spawn_cron Whether to spawn a cron process for a site. Defaults to true for single 360 * site and non-suspended sites in multisite. False for suspended sites 361 * in multisite. 362 * @param null|WP_Site $current_site Null if single site. The site for which cron will spawn if multisite. 363 */ 364 if ( false === apply_filters( 'spawn_cron_for_site', $spawn_cron, $current_site ) ) { 365 return; 366 } 367 unset( $spawn_cron, $current_site ); 368 345 369 $gmt_time = microtime( true ); 346 370 $keys = array_keys( $crons ); 347 371 if ( isset($keys[0]) && $keys[0] > $gmt_time )