wp_feed_cache_transient_lifetime

過濾鉤子
apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename )
引數
  • (int) $lifetime Cache duration in seconds. Default is 43200 seconds (12 hours).
    Required:
  • (string) $filename Unique identifier for the cache object.
    Required:
定義位置
相關勾子
pre_set_transient_transientsetted_site_transientwp_cache_themes_persistentlypre_site_transient_transientwp_mce_translation
相關方法
wp_cache_deletewp_suspend_cache_invalidationwp_cache_initwp_opcache_invalidatewp_cache_add_multiplewp_cache_reset
引入
2.8.0
棄用
-

wp_feed_cache_transient_lifetime:這是一個WordPress內建函式,用於獲取RSSfeed的快取生存時間(以秒為單位)。這可以用於配置快取的生存時間,以減少對feed源的請求次數,從而提高效能。

過濾feed快取的瞬時壽命。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename );
$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename );
$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename );

常見問題

FAQs
檢視更多 >