WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#5393 closed enhancement (fixed)

language_attributes() template tag should be able to output lang and xml:lang attributes together

Reported by: ionfish Owned by: ryan
Milestone: 2.5 Priority: low
Severity: minor Version: 2.5
Component: I18N Keywords: has-patch 2nd-opinion
Focuses: Cc:

Description

The XHTML spec states that one should

Use both the lang and xml:lang attributes when specifying the language of an element. The value of the xml:lang attribute takes precedence.

Currently the language_attributes() function will only output one or the other, depending on the html_type option.

One way of dealing with this issue would be to add a parameter to the function allowing theme authors to specify that the template in which it is used is XHTML (since as far as I know there is no way to determine this through checking the WordPress backend).

Attachments (1)

language_attributes_xhtml.patch (1.1 KB) - added by ionfish 6 years ago.
Adds a doctype parameter to the language_attributes() function.

Download all attachments as: .zip

Change History (4)

ionfish6 years ago

Adds a doctype parameter to the language_attributes() function.

comment:1 ionfish6 years ago

  • Keywords has-patch 2nd-opinion added
  • Owner changed from anonymous to ryan

comment:2 lloydbudd6 years ago

  • Milestone changed from 2.5 to 2.4

comment:3 ryan6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6408]) language_attributes() improvements from ionfish. fixes #5393

Note: See TracTickets for help on using tickets.