WordPress at Your Fingertips
function is not described

WP_Background_Process::cancel_process() public WC 1.0

Cancel Process

Stop processing queue items, clear cronjob and delete batch.

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

No Hooks.

Return

null. Nothing.

Usage

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

Code of WP_Background_Process::cancel_process() WC 5.8.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 );
	}

}