template
Filters the name of the active theme.
Usage
add_filter( 'template', 'wp_kama_template_filter' ); /** * Function for `template` filter-hook. * * @param string $template active theme's directory name. * * @return string */ function wp_kama_template_filter( $template ){ // filter... return $template; }
- $template(string)
- active theme's directory name.
Changelog
Since 1.5.0 | Introduced. |
Where the hook is called
template
wp-includes/theme.php 325
return apply_filters( 'template', get_option( 'template' ) );
Where the hook is used in WordPress
wp-includes/class-wp-customize-manager.php 688
add_filter( 'template', array( $this, 'get_template' ) );
wp-includes/class-wp-customize-manager.php 726
remove_filter( 'template', array( $this, 'get_template' ) );
wp-includes/theme-previews.php 89
add_filter( 'template', 'wp_get_theme_preview_path' );