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 10.9.4
public function cancel_action( $action_id ) {
/**
* Global.
*
* @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: we were unable to cancel this action. It may may have been deleted by another process.', 'woocommerce' ), $action_id ) );
}
do_action( 'action_scheduler_canceled_action', $action_id );
}