[wp-trac] [WordPress Trac] #61501: KSES Allow more custom data attributes to align with browsers

WordPress Trac noreply at wordpress.org
Tue Oct 21 05:10:21 UTC 2025


#61501: KSES Allow more custom data attributes to align with browsers
--------------------------------------+-----------------------
 Reporter:  jonsurrell                |       Owner:  dmsnell
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  7.0
Component:  Formatting                |     Version:  6.6
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------

Comment (by dmsnell):

 In [changeset:"61007" 61007]:
 {{{
 #!CommitTicketReference repository="" revision="61007"
 JS Interop: Add custom data attribute name converter pair.

 This patch introduces two new functions: `wp_js_dataset_name()` and
 `wp_html_custom_data_attribute_name()`. Together, these provide reliable
 mapping between the HTML attribute names for custom data attributes, and
 the properties found in JavaScript for a given `HTMLElement`’s `.dataset`
 property.

 These are to be used where matching names is important, such as in the
 Interactivity API and when WordPress is deciding whether or not to allow
 an attribute as a custom data attribute.

 Developed in https://github.com/WordPress/wordpress-develop/pull/9953
 Discussed in https://core.trac.wordpress.org/ticket/61501

 Props dmsnell, westonruter.

 See #61501.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61501#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list