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