rest_url_details_cache_expiration filter-hookWP 5.9.0

Filters the cache expiration.

Can be used to adjust the time until expiration in seconds for the cache of the data retrieved for the given URL.

Usage

add_filter( 'rest_url_details_cache_expiration', 'wp_kama_rest_url_details_cache_expiration_filter' );

/**
 * Function for `rest_url_details_cache_expiration` filter-hook.
 * 
 * @param int $ttl The time until cache expiration in seconds.
 *
 * @return int
 */
function wp_kama_rest_url_details_cache_expiration_filter( $ttl ){

	// filter...
	return $ttl;
}
$ttl(int)
The time until cache expiration in seconds.

Changelog

Since 5.9.0 Introduced.

Where the hook is called

WP_REST_URL_Details_Controller::set_cache()
rest_url_details_cache_expiration
wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php 479
$cache_expiration = apply_filters( 'rest_url_details_cache_expiration', $ttl );

Where the hook is used in WordPress

Usage not found.