WP_Community_Events::get_cached_events() WordPress Method
The WP_Community_Events::get_cached_events() method is used to get a list of cached events from the WordPress database. This method is useful for retrieving events that have already been cached in the WordPress database, and for retrieving events that have been cached in the WordPress database by other plugins or themes.
WP_Community_Events::get_cached_events() #
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
public function get_cached_events() { $cached_response = get_site_transient( $this->get_events_transient_key( $this->user_location ) ); if ( isset( $cached_response['events'] ) ) { $cached_response['events'] = $this->trim_events( $cached_response['events'] ); } return $cached_response; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.5.2 | Response no longer contains formatted date field. They're added in wp.communityEvents.populateDynamicEventFields() now. |
4.8.0 | Introduced. |