[wp-trac] [WordPress Trac] #40485: Add function for retrieving metadata from registered script

WordPress Trac noreply at wordpress.org
Wed Apr 19 17:15:34 UTC 2017


#40485: Add function for retrieving metadata from registered script
---------------------------+-----------------------------
 Reporter:  desrosj        |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Script Loader  |    Version:  trunk
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40485>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list