Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

WP_REST_URL_Details_Controller::get_cache() WordPress Method

The get_cache() method is used to retrieve the cached results of a given REST API request. This can be useful for reducing the number of requests made to the server, or for retrieving data that is not yet available via the REST API.

WP_REST_URL_Details_Controller::get_cache( string $key ) #

Utility function to retrieve a value from the cache at a given key.


Parameters

$key

(string)(Required)The cache key.


Top ↑

Return

(mixed) The value from the cache.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php

	private function get_cache( $key ) {
		return get_site_transient( $key );
	}


Top ↑

Changelog

Changelog
VersionDescription
5.9.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.