From a52b67b3d413cd59787921add2cc402e27ccd307 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sun, 24 Sep 2006 20:16:13 +0000 Subject: [PATCH] Add langauge_attributes() template tag. #3136 git-svn-id: https://develop.svn.wordpress.org/trunk@4218 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-header.php | 2 +- wp-includes/general-template.php | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index b32ea5935f..663efa940f 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -13,7 +13,7 @@ get_admin_page_title(); ?> - +> <?php bloginfo('name') ?> › <?php echo $title; ?> — WordPress diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 884830e9f9..12e771581e 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -129,15 +129,11 @@ function get_bloginfo($show='') { break; case 'language': $output = get_locale(); - if ( empty($output) ) - $output = 'en-US'; $output = str_replace('_', '-', $output); break; case 'text_direction': global $wp_locale; $output = $wp_locale->text_direction; - if ( empty($output) ) - $output = 'ltr'; break; case 'name': default: @@ -870,4 +866,15 @@ function the_search_query() { echo wp_specialchars( stripslashes($s), 1 ); } +function language_attributes() { + $output = ''; + if ( $dir = get_bloginfo('text_direction') ) + $output = "dir=\"$dir\""; + if ( $lang = get_bloginfo('language') ) { + if ( $dir ) $output .= ' '; + $output .= "lang=\"$lang\" xml:lang=\"$lang\""; + } + + echo $output; +} ?>