ActionScheduler_wpPostStore::delete_action()publicWC 1.0

Delete action.

Method of the class: ActionScheduler_wpPostStore{}

Hooks from the method

Return

null. Nothing (null).

Usage

$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore();
$ActionScheduler_wpPostStore->delete_action( $action_id );
$action_id(int) (required)
Action ID.

ActionScheduler_wpPostStore::delete_action() code WC 8.7.0

public function delete_action( $action_id ) {
	$post = get_post( $action_id );
	if ( empty( $post ) || ( self::POST_TYPE !== $post->post_type ) ) {
		/* translators: %s is the action ID */
		throw new InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
	}
	do_action( 'action_scheduler_deleted_action', $action_id );

	wp_delete_post( $action_id, true );
}