[wp-trac] [WordPress Trac] #11520: print_scripts_l10n() should use json_encode()
WordPress Trac
wp-trac at lists.automattic.com
Tue Nov 8 08:15:12 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: critical | Resolution:
Keywords: |
-------------------------+------------------------
Comment (by westi):
Replying to [comment:82 nacin]:
> I really, really like [attachment:11520-5.patch]. Curious as to westi's
opinion as well.
>
> There's a lot of changes, but it's grok-able. If we can't get this into
3.3, what should we get into 3.3 in order to set us up for 3.4?
>
> I would like to see a diff that doesn't mess with the _doing_it_wrong()
stuff. Ultimately, moving it into one function makes it more difficult to
backtrace, and it really doesn't do *that* much to abstract things out. I
know it's not very DRY, but still. :)
This looks like it gets us back somewhere more sensible and doesn't
deprecate something for no reason.
The {_doing_it_wrong()} calls should not be wrapped in another function -
one persons DRY is another persons over abstraction and this is over
abstraction (the _doing_it_wrong() function is the DRY bit). This is
especially true because we are calling it from many different places and
outputting the same message where instead the message should be much more
contextual telling you which function you are calling too early and when
you should call it.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11520#comment:83>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list