oembed_ttl

過濾鉤子
apply_filters( 'oembed_ttl', DAY_IN_SECONDS, $url, $attr, $post_ID )
引數
  • (int) $time Time to live (in seconds).
    Required:
  • (string) $url The attempted embed URL.
    Required:
  • (array) $attr An array of shortcode attributes.
    Required:
  • (int) $post_ID Post ID.
    Required:
定義位置
相關勾子
embed_htmlrest_oembed_ttloembed_resultembed_contentembed_oembed_html
相關方法
wp_oembed_get_oembed_create_xmlget_post_embed_htmlthe_embed_site_title_wp_oembed_get_objectget_embed_template
引入
4.0.0
棄用
-

oembed_ttl: 這是一個過濾器鉤子,允許開發者修改oEmbed響應的生存時間(TTL)值。TTL值是用來確定oEmbed響應應該被快取的時間長度。這個鉤子可以用來為oEmbed響應設定一個自定義的TTL值。

過濾oEmbed TTL值(生存時間)。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ttl = apply_filters( 'oembed_ttl', DAY_IN_SECONDS, $url, $attr, $post_ID );
$ttl = apply_filters( 'oembed_ttl', DAY_IN_SECONDS, $url, $attr, $post_ID );
$ttl = apply_filters( 'oembed_ttl', DAY_IN_SECONDS, $url, $attr, $post_ID );

常見問題

FAQs
檢視更多 >