get_locale_stylesheet_uri [ WordPress Function ]
| Uses: | |
| Returns: |
|
| Defined at: |
|
Retrieve 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'.
The theme may change the location of the stylesheet directory by either using the 'stylesheet_directory_uri' filter or the 'locale_stylesheet_uri' filter. 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.
Source
<?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 = '';
return apply_filters('locale_stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri);
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/get locale stylesheet uri « WordPress Codex
Description. Retrieve localized stylesheet URI. The stylesheet directory for the localized stylesheet files are located, by default, in the base theme directory.
codex.wordpress.org - Docs for page theme.php
get_locale_stylesheet_uri (line 205). Retrieve localized stylesheet URI. The stylesheet directory for the localized stylesheet files are located, by default, in the ...
phpdoc.wordpress.org - get_locale_stylesheet_uri | A HitchHackers guide through WordPress
Feb 12, 2011 ... function get_locale_stylesheet_uri() { global $wp_locale; $stylesheet_dir_uri = get_stylesheet_directory_uri(); $dir = get_stylesheet_directory(); ...
hitchhackerguide.com - get_locale_stylesheet_uri | Lovelog+*
2011年11月22日 ... WordPressのテーマ関連のファンクションタグ、get_locale_stylesheet_uriの リファレンスです。
lovelog.eternal-tears.com