函数原型
get_locale_stylesheet_uri(): string
函数描述
Retrieves the localized stylesheet URI.
是否弃用
未弃用
函数参数
无
函数返回值
string URI to active theme’s localized stylesheet.
函数位置
File: wp-includes/theme.php.
函数源码
function get_locale_stylesheet_uri() {
global $wp_locale;
$stylesheet_dir_uri = get_stylesheet_directory_uri();
$dir = get_stylesheet_directory();
$locale = get_locale();
if ( file_exists( "$dir/$locale.css" ) ) {
$stylesheet_uri = "$stylesheet_dir_uri/$locale.css";
} elseif ( ! empty( $wp_locale->text_direction ) && file_exists( "$dir/{$wp_locale->text_direction}.css" ) ) {
$stylesheet_uri = "$stylesheet_dir_uri/{$wp_locale->text_direction}.css";
} else {
$stylesheet_uri = '';
}
/**
* Filters the localized stylesheet URI.
*
* @since 2.1.0
*
* @param string $stylesheet_uri Localized stylesheet URI.
* @param string $stylesheet_dir_uri Stylesheet directory URI.
*/
return apply_filters( 'locale_stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |

