Ticket #5393: language_attributes_xhtml.patch
File language_attributes_xhtml.patch, 1.1 KB (added by , 16 years ago) |
---|
-
wp-includes/general-template.php
1008 1008 echo attribute_escape( apply_filters( 'the_search_query', get_search_query() ) ); 1009 1009 } 1010 1010 1011 function language_attributes() { 1011 function language_attributes($doctype = 'html') { 1012 $attributes = array(); 1012 1013 $output = ''; 1014 1013 1015 if ( $dir = get_bloginfo('text_direction') ) 1014 $output = "dir=\"$dir\""; 1016 $attributes[] = "dir=\"$dir\""; 1017 1015 1018 if ( $lang = get_bloginfo('language') ) { 1016 if ( $dir ) $output .= ' '; 1017 if ( get_option('html_type') == 'text/html' ) 1018 $output .= "lang=\"$lang\""; 1019 else $output .= "xml:lang=\"$lang\""; 1019 if ( get_option('html_type') == 'text/html' || $doctype == 'xhtml' ) 1020 $attributes[] = "lang=\"$lang\""; 1021 1022 if ( get_option('html_type') != 'text/html' || $doctype == 'xhtml' ) 1023 $attributes[] = "xml:lang=\"$lang\""; 1020 1024 } 1021 1025 1026 $output = implode(' ', $attributes); 1027 $output = apply_filters('language_attributes', $output); 1022 1028 echo $output; 1023 1029 } 1024 1030