WordPress.org

Make WordPress Core

Ticket #12135: general-template.php.diff

File general-template.php.diff, 995 bytes (added by shidouhikari, 5 years ago)

Adds support for XHTML 1.1 in <html> attributes

  • wp-includes/general-template.php

     
    18841884                $attributes[] = "dir=\"$dir\""; 
    18851885 
    18861886        if ( $lang = get_bloginfo('language') ) { 
    1887                 if ( get_option('html_type') == 'text/html' || $doctype == 'html' ) 
    1888                         $attributes[] = "lang=\"$lang\""; 
    1889  
    1890                 if ( get_option('html_type') != 'text/html' || $doctype == 'xhtml' ) 
     1887                // if doctype is passed as xhtml, use only xml:lang, that is supported by all XHTML versions 
     1888                if ( $doctype == 'xhtml' ) 
    18911889                        $attributes[] = "xml:lang=\"$lang\""; 
     1890                // if MIME is not text/html, use xml:lang too 
     1891                elseif ( get_option('html_type') != 'text/html' ) 
     1892                        $attributes[] = "xml:lang=\"$lang\""; 
     1893                // if doctype is not passed as xhtml and MIME is text/html, then use lang 
     1894                else 
     1895                        $attributes[] = "lang=\"$lang\""; 
    18921896        } 
    18931897 
    18941898        $output = implode(' ', $attributes);