Make WordPress Core

Changeset 4218


Ignore:
Timestamp:
09/24/2006 08:16:13 PM (20 years ago)
Author:
ryan
Message:

Add langauge_attributes() template tag. #3136

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r4217 r4218  
    1414?>
    1515<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    16 <html xmlns="http://www.w3.org/1999/xhtml" dir="<?php bloginfo('text_direction'); ?>" lang="<?php bloginfo('language'); ?>" xml:lang="<?php bloginfo('language'); ?>">
     16<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    1717<head>
    1818<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
  • trunk/wp-includes/general-template.php

    r4217 r4218  
    130130        case 'language':
    131131            $output = get_locale();
    132             if ( empty($output) )
    133                 $output = 'en-US';
    134132            $output = str_replace('_', '-', $output);
    135133            break;
     
    137135            global $wp_locale;
    138136            $output = $wp_locale->text_direction;
    139             if ( empty($output) )
    140                 $output = 'ltr';
    141137            break;
    142138        case 'name':
     
    871867}
    872868
     869function language_attributes() {
     870    $output = '';
     871    if ( $dir = get_bloginfo('text_direction') )
     872        $output = "dir=\"$dir\"";
     873    if ( $lang = get_bloginfo('language') ) {
     874        if ( $dir ) $output .= ' ';
     875        $output .= "lang=\"$lang\" xml:lang=\"$lang\"";
     876    }
     877
     878    echo $output;
     879}
    873880?>
Note: See TracChangeset for help on using the changeset viewer.