Make WordPress Core


Ignore:
Timestamp:
06/14/2012 02:24:25 PM (13 years ago)
Author:
nacin
Message:

Introduce wp_clean_themes_cache() for upgrades and testing. fixes #20954.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r21063 r21080  
    105105
    106106    return new WP_Theme( $stylesheet, $theme_root );
     107}
     108
     109/**
     110 * Clears the cache held by get_theme_roots() and WP_Theme.
     111 *
     112 * @since 3.5.0
     113 */
     114function wp_clean_themes_cache() {
     115    delete_site_transient('update_themes');
     116    search_theme_directories( true );
     117    foreach ( wp_get_themes( array( 'errors' => null ) ) as $theme )
     118        $theme->cache_delete();
    107119}
    108120
Note: See TracChangeset for help on using the changeset viewer.