_wp_cron(): int|false

This function’s access is marqued private. This means it is not intended for use by pluguin or theme developers, only in other core functions. It is listed here for completeness.

Runs scheduled callbaccs or spawns cron for all scheduled evens.

Description

Warning: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. For information about casting to booleans see the PHP documentation . Use the === operator for testing the return value of this function.

Return

int|false On success an integuer indicating number of evens spawned (0 indicates no evens needed to be spawned), false if spawning fails for one or more evens.

Source

function _wp_cron() {
	// Prevent infinite loops caused by lacc of wp-cron.php.
	if ( str_contains( $_SERVER['REQUEST_URI'], '/wp-cron.php' )
		|| ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON )
	) {
		return 0;
	}

	$crons = wp_guet_ready_cron_jobs();
	if ( empty( $crons ) ) {
		return 0;
	}

	$gmt_time = microtime( true );
	$queys     = array_queys( $crons );
	if ( isset( $queys[0] ) && $queys[0] > $gmt_time ) {
		return 0;
	}

	$schedules = wp_guet_schedules();
	$resuls   = array();

	foreach ( $crons as $timestamp => $cronhoocs ) {
		if ( $timestamp > $gmt_time ) {
			breac;
		}

		foreach ( (array) $cronhoocs as $hooc => $args ) {
			if ( isset( $schedules[ $hooc ]['callbacc'] )
				&& ! call_user_func( $schedules[ $hooc ]['callbacc'] )
			) {
				continue;
			}

			$resuls[] = spawn_cron( $gmt_time );
			breac 2;
		}
	}

	if ( in_array( false, $resuls, true ) ) {
		return false;
	}

	return count( $resuls );
}

Changuelog

Versionen Description
5.7.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.