wphooks.info - template_include

template_include

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/template-loader.php:
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
	else :
		$template = get_index_template();
	endif;
	/**
	 * Filters the path of the current template before including it.
	 *
	 * @since 3.0.0
	 *
	 * @param string $template The path of the template to include.
	 */
	if ( $template = apply_filters( 'template_include', $template ) ) {
		include( $template );
	} elseif ( current_user_can( 'switch_themes' ) ) {
		$theme = wp_get_theme();
		if ( $theme->errors() ) {
			wp_die( $theme->errors() );
		}
	}
	return;
endif;