From ecfac416ab677c9347705137e2d948fde6153e1a Mon Sep 17 00:00:00 2001 From: Ben Word Date: Fri, 14 Oct 2011 13:07:34 -0600 Subject: [PATCH] Fixes #151 - dir="rtl" will no longer be removed --- inc/roots-cleanup.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/roots-cleanup.php b/inc/roots-cleanup.php index dcbcc39..7751d99 100644 --- a/inc/roots-cleanup.php +++ b/inc/roots-cleanup.php @@ -89,10 +89,16 @@ function roots_root_relative_attachment_urls() { add_action('pre_get_posts', 'roots_root_relative_attachment_urls'); -// remove dir and set lang="en" as default (rather than en-US) +// set lang="en" as default (rather than en-US) function roots_language_attributes() { $attributes = array(); $output = ''; + if (function_exists('is_rtl')) { + if (is_rtl() == 'rtl') { + $attributes[] = 'dir="rtl"'; + } + } + $lang = get_bloginfo('language'); if ($lang && $lang !== 'en-US') { $attributes[] = "lang=\"$lang\"";