tribe_tickets_update_capacity( int|WP_Post|Tribe__Tickets__Ticket_Object $object, $capacity )
Updates a given Object Capacity
Contents
Note, you can pass an event/post to this function and it will merrily change the meta values for the event – not for the tickets!
Parameters
- $object
-
(int|WP_Post|Tribe__Tickets__Ticket_Object) (Required) Post We are trying to save capacity
- $capacty
-
(int) (Required) What we are trying to update the capacity to.
Return
(int|false)
Source
File: src/template-tags/tickets.php
function tribe_tickets_update_capacity( $object, $capacity ) {
if ( ! is_numeric( $capacity ) ) {
return false;
}
if ( ! $object instanceof WP_Post ) {
$object = get_post( $object );
}
if ( ! $object instanceof WP_Post ) {
return false;
}
// Do the actual Updating of the Meta value
return update_post_meta( $object->ID, tribe( 'tickets.handler' )->key_capacity, $capacity );
}
Changelog
| Version | Description |
|---|---|
| 4.6.2 | Introduced. |