This commit is contained in:
Hanson.xyz Dev
2026-01-04 17:50:08 -06:00
parent 7e45ce0756
commit acc8ac87a0
4131 changed files with 232562 additions and 250244 deletions
+20 -1
View File
@@ -1,6 +1,6 @@
<?php
/**
* Loads the correct template based on the visitor's url
* Loads the correct template based on the visitor's URL
*
* @package WordPress
*/
@@ -8,6 +8,16 @@ if ( wp_using_themes() ) {
/**
* Fires before determining which template to load.
*
* This action hook executes just before WordPress determines which template page to load.
* It is a good hook to use if you need to do a redirect with full knowledge of the content
* that has been queried.
*
* Note: Loading a different template is not a good use of this hook. If you include another template
* and then use `exit()` or `die()`, no subsequent `template_redirect` hooks will be run, which could
* break the sites functionality. Instead, use the {@see 'template_include'} filter hook to return
* the path to the new template you want to use. This will allow an alternative template to be used
* without interfering with the WordPress loading process.
*
* @since 1.5.0
*/
do_action( 'template_redirect' );
@@ -103,6 +113,15 @@ if ( wp_using_themes() ) {
*/
$template = apply_filters( 'template_include', $template );
if ( $template ) {
/**
* Fires immediately before including the template.
*
* @since 6.9.0
*
* @param string $template The path of the template about to be included.
*/
do_action( 'wp_before_include_template', $template );
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();