rest_oembed_ttl хук-фильтрWP 4.8.0

Filters the oEmbed TTL value (time to live).

Similar to the oembed_ttl filter, but for the REST API oEmbed proxy endpoint.


add_filter( 'rest_oembed_ttl', 'wp_kama_rest_oembed_ttl_filter', 10, 3 );

 * Function for `rest_oembed_ttl` filter-hook.
 * @param int    $time Time to live (in seconds).
 * @param string $url  The attempted embed URL.
 * @param array  $args An array of embed request arguments.
 * @return int
function wp_kama_rest_oembed_ttl_filter( $time, $url, $args ){

	// filter...
	return $time;
Time to live (in seconds).
The attempted embed URL.
An array of embed request arguments.

Список изменений

С версии 4.8.0 Введена.

Где вызывается хук

wp-includes/class-wp-oembed-controller.php 240
$ttl = apply_filters( 'rest_oembed_ttl', DAY_IN_SECONDS, $url, $args );

Где используется хук в WordPress

Использование не найдено.