ActionScheduler_wpPostStore::delete_action
Delete action.
Метод класса: ActionScheduler_wpPostStore{}
Хуки из метода
Возвращает
null. Ничего (null).
Использование
$ActionScheduler_wpPostStore = new ActionScheduler_wpPostStore(); $ActionScheduler_wpPostStore->delete_action( $action_id );
- $action_id(int) (обязательный)
- Action ID.
Код ActionScheduler_wpPostStore::delete_action() ActionScheduler wpPostStore::delete action WC 11.0.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: we were unable to delete this action. It may may have been deleted by another process.', 'woocommerce' ), $action_id ) );
}
do_action( 'action_scheduler_deleted_action', $action_id );
wp_delete_post( $action_id, true );
}