[wp-trac] [WordPress Trac] #57405: wp_localize_script() doesn't decode html entities in nested arrays

WordPress Trac noreply at wordpress.org
Wed Apr 24 09:50:29 UTC 2024


#57405: wp_localize_script() doesn't decode html entities in nested arrays
-----------------------------------------+------------------------------
 Reporter:  rilwis                       |       Owner:  (none)
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  I18N                         |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch 2nd-opinion close  |     Focuses:  javascript
-----------------------------------------+------------------------------
Changes (by swissspidy):

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


Comment:

 I don't think we'd want to modify `wp_localize_script` like this. The
 functionality has been largely unchanged for many years and there are
 multiple known oddities like this.

 Nowadays there are better alternatives such as `wp_add_inline_script` and
 `wp_set_script_translations`.

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


More information about the wp-trac mailing list