wp_get_schedules example

    if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) {
        if ( $wp_error ) {
            return new WP_Error(
                'invalid_timestamp',
                __( 'Event timestamp must be a valid Unix timestamp.' )
            );
        }

        return false;
    }

    $schedules = wp_get_schedules();

    if ( ! isset( $schedules[ $recurrence ] ) ) {
        if ( $wp_error ) {
            return new WP_Error(
                'invalid_schedule',
                __( 'Event schedule does not exist.' )
            );
        }

        return false;
    }

    
$body_class .= ' site-health';

        return $body_class;
    }

    /** * Initiates the WP_Cron schedule test cases. * * @since 5.2.0 */
    private function wp_schedule_test_init() {
        $this->schedules = wp_get_schedules();
        $this->get_cron_tasks();
    }

    /** * Populates the list of cron events and store them to a class-wide variable. * * @since 5.2.0 */
    private function get_cron_tasks() {
        $cron_tasks = _get_cron_array();

        
Home | Imprint | This part of the site doesn't use cookies.