Skip to content

Script Loading: Consider adding a data attribute which specifically contains the handle #70

@westonruter

Description

@westonruter

Is your enhancement related to a problem? Please describe.

We currently are parsing the script handle out of the id attribute for script tags. This could be made more ergonomic if we added a data-wp-handle attribute that only contained the handle, similar to how delayed inline scripts now get data-wp-deps as of #67.

Related to #68, which introduces data-wp-strategy.

Note that the attributes may need to be added after the script_loader_tag filter applies, so as to ensure they are always present. Otherwise they could break our delayed-inline-script-loader logic.

cf. https://github.com/10up/wordpress-develop/pull/67/files#r1213241271 and https://github.com/10up/wordpress-develop/pull/67/files#r1213705552

Designs

No response

Describe alternatives you've considered

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions