wp_clean_themes_cache()
wp_clean_themes_cache( bool $clear_update_cache = true …
wp_clean_themes_cache( bool $clear_update_cache = true )
清除get_theme_roots()和WP_theme保存的缓存。
Clears the cache held by get_theme_roots() and WP_Theme.
目录锚点:#参数#源码
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $clear_update_cache | (bool) | 是否清除主题更新缓存 |
源码(Source)
/**
* Clears the cache held by get_theme_roots() and WP_Theme.
*
* @since 3.5.0
* @param bool $clear_update_cache Whether to clear the Theme updates cache
*/
function wp_clean_themes_cache( $clear_update_cache = true ) {
if ( $clear_update_cache )
delete_site_transient( 'update_themes' );
search_theme_directories( true );
foreach ( wp_get_themes( array( 'errors' => null ) ) as $theme )
$theme->cache_delete();
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 3.5.0 | wp-includes/theme.php | 7 | 8 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

还没有任何评论,赶紧来占个楼吧!