[wp-trac] [WordPress Trac] #19825: Bugs and modifications to localize script
WordPress Trac
wp-trac at lists.automattic.com
Sat Jan 14 17:19:29 UTC 2012
#19825: Bugs and modifications to localize script
-------------------------+------------------------------
Reporter: ssmathias | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: |
-------------------------+------------------------------
Comment (by azaozz):
Replying to [comment:2 ssmathias]:
> [The code in 11520] is also the code, as currently implemented in trunk,
that is generating a fatal error when I attempt to pass an object into
wp_localize_script.
$wp_scripts->localize() accepts an associative array as argument, why
would you pass an object? Further it has "dual functionality": that array
can be multi-dimentional and html_entity_decode() is run only on the first
level, leaving the second + levels untouched.
Don't see any advantages in storing the associative array(s) and
json_encoding them at output (it actually used to do that at one point).
This can only bring some collision problems when localize() is called more
than once for the same script.
Also direct hacking into the $wp_scripts object is not supported as the
internals can change in newer versions.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19825#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list