Tribe__Tickets__Tickets::clear_ticket_cache_for_post( int $post_id )
Clear the ticket cache for a specific post ID.
Contents
Parameters
- $post_id
-
(int) (Required) The post ID.
Source
File: src/Tribe/Tickets.php
public function clear_ticket_cache_for_post( $post_id ) {
/** @var Tribe__Cache $cache */
$cache = tribe( 'cache' );
$class = __CLASS__;
$methods = [
'get_tickets',
];
foreach ( $methods as $method ) {
$key = $class . '::' . $method . '-' . $this->orm_provider . '-' . $post_id;
unset( $cache[ $key ] );
}
$static_methods = [
'get_all_event_tickets',
'get_event_attendees_count',
];
foreach ( $static_methods as $method ) {
$key = $class . '::' . $method . '-' . $post_id;
unset( $cache[ $key ] );
}
}
Changelog
| Version | Description |
|---|---|
| 5.1.0 | Introduced. |