template хук-фильтрWP 1.5.0

Filters the name of the active theme.

Использование

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(строка)
active theme's directory name.

Список изменений

С версии 1.5.0 Введена.

Где вызывается хук

get_template()
template
wp-includes/theme.php 325
return apply_filters( 'template', get_option( 'template' ) );

Где используется хук в WordPress

wp-includes/class-wp-customize-manager.php 683
add_filter( 'template', array( $this, 'get_template' ) );
wp-includes/class-wp-customize-manager.php 721
remove_filter( 'template', array( $this, 'get_template' ) );
wp-includes/theme-previews.php 89
add_filter( 'template', 'wp_get_theme_preview_path' );