WP_Community_Events::cache_events() – Caches an array of events data from the Events API.
You appear to be a bot. Output may be restricted
Description
Caches an array of events data from the Events API.
Usage
$bool = WP_Community_Events::cache_events( $events, $expiration );
Parameters
- $events
- ( array ) required – Response body from the API request.
- $expiration
- ( int|false ) optional – Optional. Amount of time to cache the events. Defaults to false.
Returns
bool true if events were cached; false if not.
Source
File name: wordpress/wp-admin/includes/class-wp-community-events.php
Lines:
1 to 11 of 11
protected function cache_events( $events, $expiration = false ) { $set = false; $transient_key = $this->WP_Community_Events::get_events_transient_key( $events['location'] ); $cache_expiration = $expiration ? absint( $expiration ) : HOUR_IN_SECONDS * 12; if ( $transient_key ) { $set = set_site_transient( $transient_key, $events, $cache_expiration ); } return $set; }