#54699 closed enhancement (fixed)
dir, lang, and xml:lang should be global attributes supported on all tags
Reported by: | upsuper | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 6.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Formatting | Keywords: | has-patch has-unit-tests needs-docs needs-dev-note commit |
Focuses: | Cc: |
Description
Currently in kses, dir
, lang
, and xml:lang
are only supported in several selected elements, however, as can be found in the HTML standard, they are all global attributes and can be applied to any element.
It doesn't make sense, for example, to have to write <span lang="ja"><em>こんにちは</em></span>
while you can pretty much just use <em lang="ja">こんにちは</em>
.
Change History (14)
This ticket was mentioned in PR #2087 on WordPress/wordpress-develop by upsuper.
3 years ago
#1
- Keywords has-patch has-unit-tests added
#3
@
3 years ago
- Keywords needs-docs needs-refresh added
Hi there!
Thanks for the ticket and patch!
In the PR we should add document for _wp_add_global_attributes() function. Something like:
* @since 6.0.0 Add global support for `dir`, `lang`, and `xml:lang` attributes.
This ticket was mentioned in PR #2193 on WordPress/wordpress-develop by audrasjb.
3 years ago
#5
Trac ticket: https://core.trac.wordpress.org/ticket/54699
#6
@
3 years ago
- Keywords needs-dev-note added
- Owner set to audrasjb
- Status changed from new to accepted
I added a PR to refresh the patch and to add forgotten items.
#7
@
3 years ago
@SergeyBiryukov would you mind reviewing the above PR please?
I think we're good, but just want to double check before shipping this change.
#9
@
3 years ago
Hello @upsuper, thanks for the heads up.
I think we're good to go.
I self assigned the ticket but I'm only waiting for another committer review before shipping it to milestone 6.0.
SergeyBiryukov commented on PR #2193:
3 years ago
#10
Thanks for the refreshed PR! This looks good to me, just added some more WPCS fixes and formatting adjustments.
peterwilsoncc commented on PR #2087:
3 years ago
#12
Superseded by #2193
peterwilsoncc commented on PR #2193:
3 years ago
#14
Committed in e7a9f9df4e13b94187ea362f55ddfdaa0f6911f3 (canonically https://core.trac.wordpress.org/changeset/52968)
This PR moves
dir
,lang
, andxml:lang
attributes into the global attributes in kses so that they can be used with any tag as specified in the HTML standard.Trac ticket: https://core.trac.wordpress.org/ticket/54699