[wp-trac] [WordPress Trac] #21134: Registering and enqueueing on the same action can cause enqueueing to happen before registering

WordPress Trac wp-trac at lists.automattic.com
Mon Jul 2 14:57:35 UTC 2012


#21134: Registering and enqueueing on the same action can cause enqueueing to
happen before registering
--------------------------+------------------------------
 Reporter:  nbachiyski    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.4
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by nbachiyski):

 > To me, this is what priorities are for, so that documentation issue is
 not really valid. And basically, wouldn't this be nearly the same as a

 Well, yes, but when you do this often, it is both annoying and, as I said
 – opaque.

 When I read code with priorities I have hard time understanding why the
 priority was changed from the default, unless there's a comment or we pay
 special attention and make it obvious (extract it in a function, use a
 constant/variable for the priority). It's rarely obvious from the code
 itself.

 > And: Is this setup really to be found often? Most plugins ship with
 their own copy of a script anyway, don't they?

 In our case, we're building a bigger product and we have tens of plugins,
 interacting with each other. So it is a common case for us. In the future,
 as more and more people start using WordPress as a framework to build
 larger projects, cases like this will be even more common.

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


More information about the wp-trac mailing list