WordPress at a glance
filter is not described

(type)_template filter-hook . WP 1.5.0

Filters the path of the queried template by type.

The dynamic portion of the hook name, $type, refers to the filename -- minus the file extension and any non-alphanumeric characters delimiting words -- of the file to load. This hook also applies to various types of files loaded as part of the Template Hierarchy.

Possible values for $type include: 'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date', 'embed', 'home', 'frontpage', 'privacypolicy', 'page', 'paged', 'search', 'single', 'singular', and 'attachment'.


add_filter( '(type)_template', 'filter_function_name_6837', 10, 3 );
function filter_function_name_6837( $template, $type, $templates ){
	// filter...

	return $template;
Path to the template. See locate_template().
Sanitized filename without extension.
A list of template candidates, in descending order of priority.


Since 1.5.0 Introduced.
Since 4.8.0 The $type and $templates parameters were added.

Where the hook is called

wp-includes/template.php 63
return apply_filters( "{$type}_template", $template, $type, $templates );

Where in WP core the hook is used WordPress

wp-includes/class-wp-customize-manager.php 676
add_filter( 'template', array( $this, 'get_template' ) );
wp-includes/class-wp-customize-manager.php 682
add_filter( 'pre_option_template', array( $this, 'get_template' ) );
wp-includes/class-wp-customize-manager.php 714
remove_filter( 'template', array( $this, 'get_template' ) );
wp-includes/class-wp-customize-manager.php 720
remove_filter( 'pre_option_template', array( $this, 'get_template' ) );
wp-includes/class-wp-customize-nav-menus.php 65
add_action( 'customize_controls_print_footer_scripts', array( $this, 'available_items_template' ) );
wp-includes/customize/class-wp-customize-header-image-control.php 107
add_action( 'customize_controls_print_footer_scripts', array( $this, 'print_header_image_template' ) );