ActionScheduler_DBStore::cancel_action()publicWC 1.0

Cancel an action.

{} Это метод класса: ActionScheduler_DBStore{}

Хуки из метода

Возвращает

null. Ничего.

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

$ActionScheduler_DBStore = new ActionScheduler_DBStore();
$ActionScheduler_DBStore->cancel_action( $action_id );
$action_id(int) (обязательный)
Action ID.

Код ActionScheduler_DBStore::cancel_action() WC 6.9.1

public function cancel_action( $action_id ) {
	/** @var \wpdb $wpdb */
	global $wpdb;

	$updated = $wpdb->update(
		$wpdb->actionscheduler_actions,
		array( 'status' => self::STATUS_CANCELED ),
		array( 'action_id' => $action_id ),
		array( '%s' ),
		array( '%d' )
	);
	if ( false === $updated ) {
		/* translators: %s: action ID */
		throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
	}
	do_action( 'action_scheduler_canceled_action', $action_id );
}