Ticket::increase_ticket_stock_by( $ticket_id,  $quantity = 1 )

Increase the ticket stock.


Parameters

$ticket_id

(Required) int The ticket post ID.

$quantity

(Optional) int The quantity to increase the ticket stock by.

Default value: 1


Top ↑

Return

(bool|int)


Top ↑

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 );
	}

Top ↑

Changelog

Changelog
Version Description
5.5.10 Introduced.