Opened 7 years ago
Last modified 7 years ago
#40485 new feature request
Add function for retrieving metadata from registered script
Reported by: | desrosj | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | Script Loader | Keywords: | has-patch has-unit-tests needs-testing |
Focuses: | Cc: |
Description
There is currently a function for adding metadata to a registered script (wp_script_add_data()
), but no function for retrieving that metadata.
My use case
I am trying to write a unit test for a function in my plugin that generates data and calls wp_localize_script()
to ensure the expected data is passed for localization.
Other Use Cases
I could see other use cases where a plugin could change a metadata value or add a new key if a certain value is assigned to a certain key.
Attachments (2)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Adds
wp_script_get_data()
with unit tests.