^ 回到顶部
  • 人生没有定律,每个人都有自己的节奏
  • 本站wordpress建站教程均通过实践后发布,希望对你有帮助
  • 希望你的坚持,都是因为热爱,而不是因为不甘心
  • 8年wordpress建站经验,5星服务品质
  • 那些不愿意让你吃亏的人,才是真正值得你深交的人,也是值得你付出时间的人
  • 阿里云2核2g仅需86元/年

wordpress函数get_locale_stylesheet_uri()用法示例

get_locale_stylesheet_uri()

Retrieves the localized stylesheet URI.


描述

The stylesheet directory for the localized stylesheet files are located, by default, in the base theme directory. The name of the locale file will be the locale followed by ‘.css’. If that does not exist, then the text direction stylesheet will be checked for existence, for example ‘ltr.css’.

新用户2核2g仅需86元/年    领取1153套模板    免费cdn流量包    ¥3188礼包

The theme may change the location of the stylesheet directory by either using the ‘stylesheet_directory_uri’ or ‘locale_stylesheet_uri’ filters.

If you want to change the location of the stylesheet files for the entire WordPress workflow, then change the former. If you just have the locale in a separate folder, then change the latter.


返回值

(string)


源代码

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 描述
2.1.0 Introduced.

相关函数

Uses

  • wp-includes/theme.php:
    get_stylesheet_directory_uri()
  • wp-includes/theme.php:
    get_stylesheet_directory()
  • wp-includes/theme.php:
    locale_stylesheet_uri
  • wp-includes/l10n.php:
    get_locale()
  • wp-includes/plugin.php:
    apply_filters()

Used By

  • wp-includes/theme.php:
    locale_stylesheet()

让小雨知道,这篇文章帮到了你
扫码关注微信公众号zs40086(微搜片)随时随地微信看片,抢先福利电影等你来

热门推荐

如有疑问,请前往问答中心反馈!

反馈