[wp-trac] [WordPress Trac] #11520: print_scripts_l10n() should use json_encode()

WordPress Trac wp-trac at lists.automattic.com
Mon Jul 25 16:03:34 UTC 2011

#11520: print_scripts_l10n() should use json_encode()
 Reporter:  scribu                  |       Owner:  azaozz
     Type:  enhancement             |      Status:  reviewing
 Priority:  normal                  |   Milestone:  3.3
Component:  JavaScript              |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |

Comment (by azaozz):

 Replying to [comment:23 nacin]:
 > add_script_data() is for adding script data. To me, it sounds less of a
 replacement, and more like a lower level of the API, like *_metadata().
 wp_localize_script() can be a wrapper.

 The deprecation here is only about the (old) names: `localize` and
 `..._l10n`. Even before this patch plugins were using wp_localize_script()
 to add arbitrary JS data. On the other hand having two different functions
 that do exactly the same thing may be confusing.

Ticket URL: <http://core.trac.wordpress.org/ticket/11520#comment:25>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list