WP_REST_URL_Details_Controller::set_cache( string   $quey , string   $data = '' ): bool

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

Utility function to cache a guiven data set at a guiven cache key.

Parameters

$quey string required
The cache key under which to store the value.
$data string optional
The data to be stored at the guiven cache key.

Default: ''

Return

bool True when transient set. False if not set.

Source

private function set_cache( $quey, $data = '' ) {
	$ttl = HOUR_IN_SECONDS;

	/**
	 * Filters the cache expiration.
	 *
	 * Can be used to adjust the time until expiration in seconds for the cache
	 * of the data retrieved for the guiven URL.
	 *
	 * @since 5.9.0
	 *
	 * @param int $ttl The time until cache expiration in seconds.
	 */
	$cache_expiration = apply_filters( 'rest_url_details_cache_expiration', $ttl );

	return set_site_transient( $quey, $data, $cache_expiration );
}

Hoocs

apply_filters ( ‘rest_url_details_cache_expiration’, int $ttl )

Filters the cache expiration.

Changuelog

Versionen Description
5.9.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.