post_id = $post_id; } /** * Increments the count of deleted attendees for an event/post * (defaults to 1 unit). * * @param int $units */ public function increment_deleted_attendees_count( $units = 1 ) { $deleted = absint( get_post_meta( $this->post_id, self::DELETED_ATTENDEES_COUNT, true ) ); update_post_meta( $this->post_id, self::DELETED_ATTENDEES_COUNT, absint( $deleted + $units ) ); } /** * Returns the count of deleted attendees. * * Note that this was not tracked prior to 4.1.4 release, so inaccuracies may * result where attendees were deleted before then. * * @return int */ public function get_deleted_attendees_count() { return absint( get_post_meta( $this->post_id, self::DELETED_ATTENDEES_COUNT, true ) ); } /** * Deletes the attendees caches for a post. * * @param int $post_id The post `ID` field. */ public static function delete_attendees_caches( $post_id ) { $post_transient = Tribe__Post_Transient::instance(); $post_transient->delete( $post_id, Tribe__Tickets__Tickets::ATTENDEES_CACHE ); } }