Merge pull request #942 from roots/language-attributes

Remove lang cleanup and fix dir
This commit is contained in:
Scott Walkinshaw
2013-12-14 14:42:21 -08:00

View File

@@ -50,25 +50,20 @@ add_filter('the_generator', '__return_false');
/** /**
* Clean up language_attributes() used in <html> tag * Clean up language_attributes() used in <html> tag
* *
* Change lang="en-US" to lang="en"
* Remove dir="ltr" * Remove dir="ltr"
*/ */
function roots_language_attributes() { function roots_language_attributes() {
$attributes = array(); $attributes = array();
$output = ''; $output = '';
if (function_exists('is_rtl')) { if (is_rtl()) {
if (is_rtl() == 'rtl') { $attributes[] = 'dir="rtl"';
$attributes[] = 'dir="rtl"';
}
} }
$lang = get_bloginfo('language'); $lang = get_bloginfo('language');
if ($lang && $lang !== 'en-US') { if ($lang) {
$attributes[] = "lang=\"$lang\""; $attributes[] = "lang=\"$lang\"";
} else {
$attributes[] = 'lang="en"';
} }
$output = implode(' ', $attributes); $output = implode(' ', $attributes);