[wp-trac] [WordPress Trac] #25280: wp_localize_script unexpectedly converts numbers to strings

WordPress Trac noreply at wordpress.org
Thu Sep 10 12:22:33 UTC 2020


#25280: wp_localize_script unexpectedly converts numbers to strings
-------------------------------------------------+-------------------------
 Reporter:  adamsilverstein                      |       Owner:
                                                 |  adamsilverstein
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:
Component:  Script Loader                        |     Version:  3.2
 Severity:  normal                               |  Resolution:  wontfix
 Keywords:  has-patch dev-feedback has-unit-     |     Focuses:  javascript
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by andraganescu):

 @nerrad I was looking up this function and the docs
 [https://developer.wordpress.org/reference/functions/wp_localize_script/
 here] actually recommend using it "to make any data available to your
 script that you can normally only get from the server side of WordPress.".

 I would be good to update that. When you say now there is can you point me
 to a specific alternative?

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


More information about the wp-trac mailing list