From 4192053c3b889fe6a0d33813ff8c528ba60dd00b Mon Sep 17 00:00:00 2001 From: Scott Walkinshaw Date: Mon, 11 Jul 2011 12:55:11 -0600 Subject: [PATCH] Updated language attributes to work nicely with qTranslate - fixes #80 --- inc/roots-cleanup.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/inc/roots-cleanup.php b/inc/roots-cleanup.php index 1278ca9..434802d 100644 --- a/inc/roots-cleanup.php +++ b/inc/roots-cleanup.php @@ -132,15 +132,16 @@ add_action('pre_get_posts', 'roots_relative_feed_urls' ); function roots_language_attributes() { $attributes = array(); $output = ''; - if (!defined('WP_LANG')) { - $attributes[] = "lang=\"en\""; - } else if ($lang = get_bloginfo('language')) { - $attributes[] = "lang=\"$lang\""; - } + $lang = get_bloginfo('language'); + if ($lang && $lang !== 'en-US') { + $attributes[] = "lang=\"$lang\""; + } else { + $attributes[] = 'lang="en"'; + } $output = implode(' ', $attributes); $output = apply_filters('roots_language_attributes', $output); - echo $output; + return $output; } add_filter('language_attributes', 'roots_language_attributes');