[wp-trac] [WordPress Trac] #56425: wp_localize_script assign to const and freeze instead of var to avoid reassignments

WordPress Trac noreply at wordpress.org
Mon Nov 7 17:50:19 UTC 2022


#56425: wp_localize_script assign to const and freeze instead of var to avoid
reassignments
-----------------------------------------+------------------------------
 Reporter:  malthert                     |       Owner:  (none)
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Script Loader                |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch 2nd-opinion close  |     Focuses:  javascript
-----------------------------------------+------------------------------
Changes (by TimothyBlynJacobs):

 * keywords:  has-patch 2nd-opinion => has-patch 2nd-opinion close


Comment:

 Agreed. We also have a more customizable API for this nowadays with
 `wp_add_inline_script` which I think we should be encouraging people to
 move to.

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


More information about the wp-trac mailing list