Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_cache_themes_persistently

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
436
437      /**
438       * Filters whether to get the cache of the registered theme directories.
439       *
440       * @since 3.4.0
441       *
442       * @param bool   $cache_expiration Whether to get the cache of the theme directories. Default false.
443       * @param string $cache_directory  Directory to be searched for the cache.
444       */
445      if ( $cache_expiration = apply_filters( 'wp_cache_themes_persistently', false, 'search_theme_directories' ) ) {
446           $cached_roots = get_site_transient( 'theme_roots' );
447           if ( is_array( $cached_roots ) ) {
448                foreach ( $cached_roots as $theme_dir => $theme_root ) {
449                     // A cached theme root is no longer around, so skip it.
450                     if ( ! isset( $relative_theme_roots[ $theme_root ] ) )
451                          continue;
452                     $found_themes[ $theme_dir ] = array(
453                          'theme_file' => $theme_dir . '/style.css',
454                          'theme_root' => $relative_theme_roots[ $theme_root ], // Convert relative to absolute.