[wp-trac] [WordPress Trac] #24724: _wpMediaViewsL10n not correctly enqueued in wp_enqueue_media()

WordPress Trac noreply at wordpress.org
Wed Jul 10 23:46:19 UTC 2013


#24724: _wpMediaViewsL10n not correctly enqueued in wp_enqueue_media()
--------------------------+------------------------------
 Reporter:  Fab1en        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  3.5.2
 Severity:  trivial       |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by nacin):

 It seems that this could occur when wp_enqueue_media() is used after
 wp_head, and thus scripts start to immediately be printed rather than
 being enqueued.

 I'm not sure, though, I understand. wp_localize_script() can be called at
 any time after the handle is registered. In this case, media-views and
 media-editor are both registered by wp-includes/script-loader.php.

 By calling wp_localize_script() first, we ensure that 'media-views' is
 localized by the time it is enqueued (by way of being a dependency of
 media-editor).

 If wp_localize_script() came after the enqueue, then I'd definitely
 understand the potential problem (as described in my first sentence).
 That's what's being suggested, but it seems wrong/backwards.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24724#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list