[wp-trac] [WordPress Trac] #24770: Function "do_items" calls "do_item" with an unexpected parameter

WordPress Trac noreply at wordpress.org
Tue Jul 16 12:12:29 UTC 2013


#24770: Function "do_items" calls "do_item" with an unexpected parameter
-------------------------+-------------------------------------------------
 Reporter:               |      Owner:
  riccardo.raneri        |     Status:  new
     Type:  defect       |  Milestone:  Awaiting Review
  (bug)                  |    Version:  3.5.2
 Priority:  normal       |   Keywords:  needs-patch 2nd-opinion needs-
Component:  General      |  testing
 Severity:  major        |
-------------------------+-------------------------------------------------
 file: wp-includes/class.wp-dependencies.php - LINE 49

 do_items( $handles = false, $group = false ) calls do_item:

 {{{
                                 if ( $this->do_item( $handle, $group ) )
                                         $this->done[] = $handle;
 }}}

 but do_item( $handle ) wants a single argument:

 {{{
         function do_item( $handle ) {
                 return isset($this->registered[$handle]);
         }
 }}}

 This seems to cause problems with wp_enqueue_script, in fact I can't add
 already registered libraries (jquery-ui and their plugins), and I
 encountered a number of users that reported the same problem, eg:
 http://wordpress.stackexchange.com/questions/73883/why-is-wp-enqueue-
 script-not-loading-included-jquery-ui-scripts

 Removing $group from the parameters seems to fix the problem:

 {{{
                                 if ( $this->do_item( $handle ) )
                                         $this->done[] = $handle;
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24770>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list