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 11<?php
22/**
3- * Loads the correct template based on the visitor's url
3+ * Loads the correct template based on the visitor's URL
44 *
55 * @package WordPress
66 */
77if ( wp_using_themes () ) {
88 /**
99 * Fires before determining which template to load.
1010 *
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+ *
1121 * @since 1.5.0
1222 */
1323 do_action ( 'template_redirect ' );
You can’t perform that action at this time.
0 commit comments