ActionScheduler_DBStore::cancel_action()
Cancel an action.
Метод класса: ActionScheduler_DBStore{}
Хуки из метода
Возвращает
null
. Ничего (null).
Использование
$ActionScheduler_DBStore = new ActionScheduler_DBStore(); $ActionScheduler_DBStore->cancel_action( $action_id );
- $action_id(int) (обязательный)
- Action ID.
Код ActionScheduler_DBStore::cancel_action() ActionScheduler DBStore::cancel action WC 8.7.0
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 ); }