WP_Background_Process::cancel_process()publicWC 1.0

Cancel Process

Stop processing queue items, clear cronjob and delete batch.

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

Хуков нет.

Возвращает

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

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

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

Код WP_Background_Process::cancel_process() WC 8.7.0

public function cancel_process() {
	if ( ! $this->is_queue_empty() ) {
		$batch = $this->get_batch();

		$this->delete( $batch->key );

		wp_clear_scheduled_hook( $this->cron_hook_identifier );
	}

}