_get_cron_array example

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();

        if ( empty( $cron_tasks ) ) {
            $this->crons = new WP_Error( 'no_tasks', __( 'No scheduled events exist on this site.' ) );
            return;
        }

        $this->crons = array();

        foreach ( $cron_tasks as $time => $cron ) {
            foreach ( $cron as $hook => $dings ) {
                foreach ( $dings as $sig => $data ) {

                    

    $crons = _get_cron_array();

    $key       = md5( serialize( $event->args ) );
    $duplicate = false;

    if ( $event->timestamp < time() + 10 * MINUTE_IN_SECONDS ) {
        $min_timestamp = 0;
    } else {
        $min_timestamp = $event->timestamp - 10 * MINUTE_IN_SECONDS;
    }

    if ( $event->timestamp < time() ) {
        
global $mode$wp_query$post_mime_types$avail_post_mime_types;

        $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];

        /* * Exclude attachments scheduled for deletion in the next two hours * if they are for zip packages for interrupted or failed updates. * See File_Upload_Upgrader class. */
        $not_in = array();

        $crons = _get_cron_array();

        if ( is_array( $crons ) ) {
            foreach ( $crons as $cron ) {
                if ( isset( $cron['upgrader_scheduled_cleanup'] ) ) {
                    $details = reset( $cron['upgrader_scheduled_cleanup'] );

                    if ( ! empty( $details['args'][0] ) ) {
                        $not_in[] = (int) $details['args'][0];
                    }
                }
            }
        }

}

/** * Executes changes made in WordPress 4.3.1. * * @ignore * @since 4.3.1 */
function upgrade_431() {
    // Fix incorrect cron entries for term splitting.     $cron_array = _get_cron_array();
    if ( isset( $cron_array['wp_batch_split_terms'] ) ) {
        unset( $cron_array['wp_batch_split_terms'] );
        _set_cron_array( $cron_array );
    }
}

/** * Executes changes made in WordPress 4.4.0. * * @ignore * @since 4.4.0 * * @global int $wp_current_db_version The old (current) database version. * @global wpdb $wpdb WordPress database abstraction object. */
Home | Imprint | This part of the site doesn't use cookies.