rest_oembed_ttl WordPress Filter Hook

The rest_oembed_ttl WordPress hook allows you to change the default cache duration for oEmbed results. This is useful if you want to ensure that your oEmbed results are always up-to-date. By default, WordPress will cache oEmbed results for 12 hours.

apply_filters( 'rest_oembed_ttl', int $time, string $url, array $args ) #

Filters the oEmbed TTL value (time to live).


Description

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


Top ↑

Parameters

$time

(int)Time to live (in seconds).

$url

(string)The attempted embed URL.

$args

(array)An array of embed request arguments.


Top ↑

Source

File: wp-includes/class-wp-oembed-controller.php

View on Trac



Top ↑

Changelog

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