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.


Top ↑

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;
	}


Top ↑

Changelog

Changelog
VersionDescription
5.5.2Response no longer contains formatted date field. They're added in wp.communityEvents.populateDynamicEventFields() now.
4.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.