[wp-trac] [WordPress Trac] #59972: Clarify description of wp_script_add_data()

WordPress Trac noreply at wordpress.org
Thu Jul 25 12:01:56 UTC 2024


#59972: Clarify description of wp_script_add_data()
---------------------------+------------------------------
 Reporter:  crstauf        |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  needs-patch    |     Focuses:  docs
---------------------------+------------------------------

Comment (by niravsherasiya7707):

 @crstauf I recommend updating the function name because
 `wp_script_add_data` might raise the question, "Which data?".

 The purpose of this function is to add attributes to the script if
 `wp_script_add_data` matches the 'browser version' when the 'conditional'
 value is passed as `$key` or the strategy 'defer' or 'async' is used.

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


More information about the wp-trac mailing list