Make WordPress Core

Opened 4 weeks ago

Closed 3 weeks ago

#64511 closed task (blessed) (fixed)

Deprecate wp_sanitize_script_attributes()

Reported by: jonsurrell's profile jonsurrell Owned by: jonsurrell's profile jonsurrell
Milestone: 7.0 Priority: normal
Severity: normal Version:
Component: Script Loader Keywords: has-patch has-unit-tests commit
Focuses: Cc:

Description (last modified by jonsurrell)

The 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: wp_get_script_tag() and 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.

Change History (7)

#2 @jonsurrell
4 weeks ago

  • Description modified (diff)

This ticket was mentioned in PR #10742 on WordPress/wordpress-develop by @jonsurrell.


4 weeks ago
#3

  • Keywords has-patch has-unit-tests added

Deprecate wp_sanitize_script_attributes(). It is unused in Core and superseded by better alternatives like wp_get_script_tag() and wp_get_inline_script_tag().

Trac ticket: https://core.trac.wordpress.org/ticket/64511

#4 @westonruter
3 weeks ago

  • Keywords commit added

#5 @jonsurrell
3 weeks ago

  • Description modified (diff)

#6 @jonsurrell
3 weeks ago

  • Description modified (diff)

#7 @jonsurrell
3 weeks ago

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

In 61518:

Script Loader: Deprecate wp_sanitize_script_attributes().

The function is no longer used by WordPress and better alternatives are available: wp_get_script_tag() and wp_get_inline_script_tag().

Developed in https://github.com/WordPress/wordpress-develop/pull/10742.

Follow-up to [61415], [61485].

Props jonsurrell, westonruter.
Fixes #64511. See #64442.

Note: See TracTickets for help on using tickets.