WP_Background_Process::maybe_handle()publicWC 1.0

Maybe process queue

Checks whether data exists within the queue and that the process is not already running.

Метод класса: WP_Background_Process{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WP_Background_Process = new WP_Background_Process();
$WP_Background_Process->maybe_handle();

Код WP_Background_Process::maybe_handle() WC 8.7.0

public function maybe_handle() {
	// Don't lock up other requests while processing
	session_write_close();

	if ( $this->is_process_running() ) {
		// Background process already running.
		wp_die();
	}

	if ( $this->is_queue_empty() ) {
		// No data to process.
		wp_die();
	}

	check_ajax_referer( $this->identifier, 'nonce' );

	$this->handle();

	wp_die();
}