Skip to content

Commit

Permalink
Merge pull request roots#942 from roots/language-attributes
Browse files Browse the repository at this point in the history
Remove lang cleanup and fix dir
  • Loading branch information
swalkinshaw committed Dec 14, 2013
2 parents 72fa70a + d19f17b commit 17ea601
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/cleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,20 @@ function roots_rel_canonical() {
/**
* Clean up language_attributes() used in <html> tag
*
* Change lang="en-US" to lang="en"
* Remove dir="ltr"
*/
function roots_language_attributes() {
$attributes = array();
$output = '';

if (function_exists('is_rtl')) {
if (is_rtl() == 'rtl') {
$attributes[] = 'dir="rtl"';
}
if (is_rtl()) {
$attributes[] = 'dir="rtl"';
}

$lang = get_bloginfo('language');

if ($lang && $lang !== 'en-US') {
if ($lang) {
$attributes[] = "lang=\"$lang\"";
} else {
$attributes[] = 'lang="en"';
}

$output = implode(' ', $attributes);
Expand Down

0 comments on commit 17ea601

Please sign in to comment.