Ticket::increase_ticket_stock_by( $ticket_id, $quantity = 1 )
Increase the ticket stock.
Contents
Parameters
- $ticket_id
-
(Required) int The ticket post ID.
- $quantity
-
(Optional) int The quantity to increase the ticket stock by.
Default value: 1
Return
(bool|int)
Source
File: src/Tickets/Commerce/Ticket.php
public function increase_ticket_stock_by( $ticket_id, $quantity = 1 ) {
$stock = (int) get_post_meta( $ticket_id, static::$stock_meta_key, true ) + $quantity;
return update_post_meta( $ticket_id, static::$stock_meta_key, $stock );
}
Changelog
| Version | Description |
|---|---|
| 5.5.10 | Introduced. |