template_directory WordPress Filter Hook

The template_directory WordPress hook allows you to change the location of the default WordPress template files. This can be useful if you want to use a custom template or if you want to move the template files to a different location.

apply_filters( 'template_directory', string $template_dir, string $template, string $theme_root ) #

Filters the active theme directory path.


Parameters

$template_dir

(string)The path of the active theme directory.

$template

(string)Directory name of the active theme.

$theme_root

(string)Absolute path to the themes directory.


Top ↑

Source

File: wp-includes/theme.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More