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
212       * @param string        $theme_root Theme root.
213       * @param WP_Theme|null $_child If this theme is a parent theme, the child may be passed for validation purposes.
214       */
215      public function __construct( $theme_dir, $theme_root, $_child = null ) {
216           global $wp_theme_directories;
217
218           // Initialize caching on first run.
219           if ( ! isset( self::$persistently_cache ) ) {
220                /** This action is documented in wp-includes/theme.php */
221                self::$persistently_cache = apply_filters( 'wp_cache_themes_persistently', false, 'WP_Theme' );
222                if ( self::$persistently_cache ) {
223                     wp_cache_add_global_groups( 'themes' );
224                     if ( is_int( self::$persistently_cache ) ) {
225                          self::$cache_expiration = self::$persistently_cache;
226                     }
227                } else {
228                     wp_cache_add_non_persistent_groups( 'themes' );
229                }
230           }