wp_clean_plugins_cache

函式
wp_clean_plugins_cache ( $clear_update_cache = true )
引數
  • (bool) $clear_update_cache Whether to clear the plugin updates cache. Default true.
    Required:
    Default: true
定義位置
相關方法
clean_page_cacheclean_post_cachewp_clean_update_cacheclean_user_cachewp_clean_themes_cache
引入
3.7.0
棄用
-

wp_clean_plugins_cache: 這是一個清除已安裝外掛的快取的函式。它可以用來確保對外掛所做的任何改動都能立即反映在網站上。

清除get_plugins()使用的外掛快取,預設情況下,外掛更新快取。

function wp_clean_plugins_cache( $clear_update_cache = true ) {
	if ( $clear_update_cache ) {
		delete_site_transient( 'update_plugins' );
	}
	wp_cache_delete( 'plugins', 'plugins' );
}

常見問題

FAQs
檢視更多 >