locale_stylesheet() WordPress Function
The locale_stylesheet() function is used to load a locale-specific stylesheet. This is useful for when a site needs to be displayed in different languages, and each language has its own stylesheet. The function takes two parameters: the first is the name of the stylesheet, and the second is the locale. The stylesheet will be loaded from the '/css/locale/' directory.
locale_stylesheet() #
Displays localized stylesheet link element.
Source
File: wp-includes/theme.php
function locale_stylesheet() {
$stylesheet = get_locale_stylesheet_uri();
if ( empty( $stylesheet ) ) {
return;
}
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
printf(
'<link rel="stylesheet" href="%s"%s media="screen" />',
$stylesheet,
$type_attr
);
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |