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
	);
}


Top ↑

Changelog

Changelog
VersionDescription
2.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More