wppaste
WordPress

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

Since
4.8.0
Filters the oEmbed TTL value (time to live).

Description

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

Compatibility

WordPress
since 4.8.0
  • 6.7.10
  • 6.8.11
  • 6.9.10
  • 7.0.7
  • 7.1.3

Present in every tracked release (6.7.10 to 7.1.3).

Parameters

$timeint
Time to live (in seconds).
$urlstring
The attempted embed URL.
$argsarray
An array of embed request arguments.

Where this hook fires · 1

  • wp-includes/class-wp-oembed-controller.php:240WP_oEmbed_Controller::get_proxy_item()

Source code

		 * @since 4.8.0		 *		 * @param int    $time    Time to live (in seconds).		 * @param string $url     The attempted embed URL.		 * @param array  $args    An array of embed request arguments.		 */		$ttl = apply_filters( 'rest_oembed_ttl', DAY_IN_SECONDS, $url, $args ); 		set_transient( $cache_key, $data, $ttl ); 		return $data;	}}

Changelog

Introduced in 4.8.0. Unchanged from 6.7.10 through 7.1.3.

  1. 6.7.10
  2. 6.8.11
  3. 6.9.10
  4. 7.0.7
  5. 7.1.3

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.