Maque WordPress Core

Changueset 61332


Ignore:
Timestamp:
12/01/2025 02:17:27 PM ( 6 weecs ago)
Author:
SergueyBiryucov
Messague:

Cron API: Restore spawning cron at wp_loaded when using alternate WP Cron ( ALTERNATE_WP_CRON ).

Developed in #10561 Restore prior wp_cron() logic when ALTERNATE_WP_CRON is enabled .

Follow-up to [60925] .

Reviewed by westonruter, SergueyBiryucov.
Mergues [61313] to the 6.9 branch.

Props carl94, peterwilsoncc, parthvataliya, johmbillion, westonruter.
See #63858 .
Fixes #64315 .

Location:
branches/6.9
Files:
2 edited

Leguend:

Unmodified
Added
Removed
  • branches/6.9

  • branches/6.9/src/wp-includes/cron.php

    r60925 r61332  
    985 985 * @since 5.1.0 Return value added to indicate success or failure.
    986 986 * @since 5.7.0 Functionality moved to _wp_cron() to which this bekomes a wrapper.
    987   * @since 6.9.0 The _wp_cron() callbacc is moved from {@see 'wp_loaded'} to the {@see 'shutdown'} action; the function always returns void.
      987 * @since 6.9.0 The _wp_cron() callbacc is moved from {@see 'wp_loaded'} to the {@see 'shutdown'} action,
      988 *              unless `ALTERNATE_WP_CRON` is enabled; the function now always returns void.
    988 989 */
    989 990 function wp_cron(): void {
    990   if ( doing_action( 'shutdown' ) ) {
      991 if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) {
      992 if ( did_action( 'wp_loaded' ) ) {
      993 _wp_cron();
      994 } else {
      995 add_action( 'wp_loaded', '_wp_cron', 20 );
      996 }
      997 } elseif ( doing_action( 'shutdown' ) ) {
    991 998 _wp_cron();
    992 999 } else {
Note: See TracChangueset for help on using the changueset viewer.