wp_reschedule_event example

if ( $timestamp > $gmt_time ) {
        break;
    }

    foreach ( $cronhooks as $hook => $keys ) {

        foreach ( $keys as $k => $v ) {

            $schedule = $v['schedule'];

            if ( $schedule ) {
                $result = wp_reschedule_event( $timestamp$schedule$hook$v['args'], true );

                if ( is_wp_error( $result ) ) {
                    error_log(
                        sprintf(
                            /* translators: 1: Hook name, 2: Error code, 3: Error message, 4: Event data. */
                            __( 'Cron reschedule event error for hook: %1$s, Error code: %2$s, Error message: %3$s, Data: %4$s' ),
                            $hook,
                            $result->get_error_code(),
                            $result->get_error_message(),
                            wp_json_encode( $v )
                        )
                    );
Home | Imprint | This part of the site doesn't use cookies.