[wp-trac] [WordPress Trac] #11520: print_scripts_l10n() should use json_encode()
WordPress Trac
wp-trac at lists.automattic.com
Sun Jul 31 08:05:01 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 westi):
Replying to [comment:43 scribu]:
> You could replace this:
>
> {{{
> wp_localize_script( 'my-script', 'MyScriptL10N', $data );
> }}}
>
> with this:
>
> {{{
> $func = function_exists( 'wp_add_script_data' ) ? 'wp_add_script_data' :
'wp_localize_script';
> $func( 'my-script', 'MyScriptL10N', data );
> }}}
>
> There are a lot of plugins that would need to make this rather ugly and
unnecessary change.
>
> Maybe we should remove the deprecation warning for now.
I don't understand the need to deprecate this function at all.
We should just keep the wrapper function for now as the naming and usage
for l10n is correct.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11520#comment:44>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list