On this page
WP_Community_Events::get_cached_events(): array|false
Gets cached events.
Return
array|false An array containing location and events items on success, false on failure.
Source
File: wp-admin/includes/class-wp-community-events.php. View all references
public function get_cached_events() {
$transient_key = $this->get_events_transient_key( $this->user_location );
if ( ! $transient_key ) {
return false;
}
$cached_response = get_site_transient( $transient_key );
if ( isset( $cached_response['events'] ) ) {
$cached_response['events'] = $this->trim_events( $cached_response['events'] );
}
return $cached_response;
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Community_Events::trim_events() wp-admin/includes/class-wp-community-events.php | Prepares the event list for presentation. |
| WP_Community_Events::get_events_transient_key() wp-admin/includes/class-wp-community-events.php | Generates a transient key based on user location. |
| get_site_transient() wp-includes/option.php | Retrieves the value of a site transient. |
Used By
| Used By | Description |
|---|---|
| WP_Community_Events::get_events() wp-admin/includes/class-wp-community-events.php | Gets data about events near a particular location. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_community_events/get_cached_events