WordPress at Your Fingertips
function is not described

WC_Install::create_cron_jobs() private WC 1.0

Create cron jobs (clear them first).

{} It's a method of the class: WC_Install{}

Return

null. Nothing.

Usage

$result = WC_Install::create_cron_jobs();

Code of WC_Install::create_cron_jobs() WC 5.6.0

private static function create_cron_jobs() {
	wp_clear_scheduled_hook( 'woocommerce_scheduled_sales' );
	wp_clear_scheduled_hook( 'woocommerce_cancel_unpaid_orders' );
	wp_clear_scheduled_hook( 'woocommerce_cleanup_sessions' );
	wp_clear_scheduled_hook( 'woocommerce_cleanup_personal_data' );
	wp_clear_scheduled_hook( 'woocommerce_cleanup_logs' );
	wp_clear_scheduled_hook( 'woocommerce_geoip_updater' );
	wp_clear_scheduled_hook( 'woocommerce_tracker_send_event' );

	$ve = get_option( 'gmt_offset' ) > 0 ? '-' : '+';

	wp_schedule_event( strtotime( '00:00 tomorrow ' . $ve . absint( get_option( 'gmt_offset' ) ) . ' HOURS' ), 'daily', 'woocommerce_scheduled_sales' );

	$held_duration = get_option( 'woocommerce_hold_stock_minutes', '60' );

	if ( '' !== $held_duration ) {
		$cancel_unpaid_interval = apply_filters( 'woocommerce_cancel_unpaid_orders_interval_minutes', absint( $held_duration ) );
		wp_schedule_single_event( time() + ( absint( $cancel_unpaid_interval ) * 60 ), 'woocommerce_cancel_unpaid_orders' );
	}

	// Delay the first run of `woocommerce_cleanup_personal_data` by 10 seconds
	// so it doesn't occur in the same request. WooCommerce Admin also schedules
	// a daily cron that gets lost due to a race condition. WC_Privacy's background
	// processing instance updates the cron schedule from within a cron job.
	wp_schedule_event( time() + 10, 'daily', 'woocommerce_cleanup_personal_data' );
	wp_schedule_event( time() + ( 3 * HOUR_IN_SECONDS ), 'daily', 'woocommerce_cleanup_logs' );
	wp_schedule_event( time() + ( 6 * HOUR_IN_SECONDS ), 'twicedaily', 'woocommerce_cleanup_sessions' );
	wp_schedule_event( time() + MINUTE_IN_SECONDS, 'fifteendays', 'woocommerce_geoip_updater' );
	wp_schedule_event( time() + 10, apply_filters( 'woocommerce_tracker_event_recurrence', 'daily' ), 'woocommerce_tracker_send_event' );
}