rest_url_details_cache_expiration
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
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 );