[wp-trac] [WordPress Trac] #21520: Prevent recursive script dependencies in wp_enqueue_script

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 8 18:04:43 UTC 2012


#21520: Prevent recursive script dependencies in wp_enqueue_script
--------------------------+------------------------------
 Reporter:  batmoo        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by azaozz):

 Wouldn't that break WP_Dependencies and throw PHP fatal error the first
 time it's attempted (so the dev that tried it would know he did something
 wrong)?

 If we go there we may need to handle circular dependencies too. Example:

 {{{
 add_action( 'init', 'deps_test' );
 function deps_test() {
         wp_register_script( 'my-1', '/one.js', array('my-2'), '123', true
 );
         wp_register_script( 'my-2', '/two.js', array('my-1'), '123', true
 );

         wp_enqueue_script('my-1');
 }
 }}}

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


More information about the wp-trac mailing list