File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Loads the correct template based on the visitor's url
3
+ * Loads the correct template based on the visitor's URL
4
4
*
5
5
* @package WordPress
6
6
*/
7
7
if ( wp_using_themes () ) {
8
8
/**
9
9
* Fires before determining which template to load.
10
10
*
11
+ * This action hook executes just before WordPress determines which template page to load.
12
+ * It is a good hook to use if you need to do a redirect with full knowledge of the content
13
+ * that has been queried.
14
+ *
15
+ * Note: Loading a different template is not a good use of this hook. If you include another template
16
+ * and then use `exit()` or `die()`, no subsequent `template_redirect` hooks will be run, which could
17
+ * break the site’s functionality. Instead, use the {@see 'template_include'} filter hook to return
18
+ * the path to the new template you want to use. This will allow an alternative template to be used
19
+ * without interfering with the WordPress loading process.
20
+ *
11
21
* @since 1.5.0
12
22
*/
13
23
do_action ( 'template_redirect ' );
You can’t perform that action at this time.
0 commit comments