[wp-trac] [WordPress Trac] #64511: Deprecate wp_sanitize_script_attributes()

WordPress Trac noreply at wordpress.org
Fri Jan 23 16:55:44 UTC 2026


#64511: Deprecate wp_sanitize_script_attributes()
---------------------------------------------+-------------------------
 Reporter:  jonsurrell                       |       Owner:  jonsurrell
     Type:  task (blessed)                   |      Status:  assigned
 Priority:  normal                           |   Milestone:  7.0
Component:  Script Loader                    |     Version:
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+-------------------------
Description changed by jonsurrell:

Old description:

> The `wp_sanitize_script_attributes()`
> [https://developer.wordpress.org/reference/functions/wp_sanitize_script_attributes/
> function] is no longer used by WordPress Core since [61485]. Its
> additional utility of adding a `type` attribute was removed in [61415] as
> part of #64442.
>
> WordPress offers robust functionality for working with script tags:
> [https://developer.wordpress.org/reference/functions/wp_get_script_tag/
> wp_get_script_tag()] and
> [https://developer.wordpress.org/reference/functions/wp_get_inline_script_tag/
> wp_get_inline_script_tag()]. Developers are better off with these tools
> that work with complete SCRIPT tags instead of partial snippets of HTML
> text.

New description:

 The `wp_sanitize_script_attributes()`
 [https://developer.wordpress.org/reference/functions/wp_sanitize_script_attributes/
 function] is no longer used by WordPress Core since [61485]. Its
 additional utility of adding a `type` attribute was removed in [61440] as
 part of #64428.

 WordPress offers robust functionality for working with script tags:
 [https://developer.wordpress.org/reference/functions/wp_get_script_tag/
 wp_get_script_tag()] and
 [https://developer.wordpress.org/reference/functions/wp_get_inline_script_tag/
 wp_get_inline_script_tag()]. Developers are better off with these tools
 that work with complete SCRIPT tags instead of partial snippets of HTML
 text.

--

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


More information about the wp-trac mailing list