template_directory
Filters the active theme directory path.
Использование
add_filter( 'template_directory', 'wp_kama_template_directory_filter', 10, 3 ); /** * Function for `template_directory` filter-hook. * * @param string $template_dir The path of the active theme directory. * @param string $template Directory name of the active theme. * @param string $theme_root Absolute path to the themes directory. * * @return string */ function wp_kama_template_directory_filter( $template_dir, $template, $theme_root ){ // filter... return $template_dir; }
- $template_dir(строка)
- The path of the active theme directory.
- $template(строка)
- Directory name of the active theme.
- $theme_root(строка)
- Absolute path to the themes directory.
Список изменений
С версии 1.5.0 | Введена. |
Где вызывается хук
template_directory
wp-includes/theme.php 345
return apply_filters( 'template_directory', $template_dir, $template, $theme_root );