[wp-trac] [WordPress Trac] #17911: WP_Dependencies::remove() may generate PHP Warning

WordPress Trac wp-trac at lists.automattic.com
Sun Sep 11 17:18:55 UTC 2011


#17911: WP_Dependencies::remove() may generate PHP Warning
------------------------------+------------------------------
 Reporter:  ftrudeau          |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Warnings/Notices  |     Version:  3.1.3
 Severity:  minor             |  Resolution:
 Keywords:  needs-patch       |
------------------------------+------------------------------

Comment (by azaozz):

 WP_Dependencies::remove() expects a single `$handle` (the name a script or
 stylesheet was registered with) or an array of handles if you want to
 remove more than one at the same time. WP_Dependencies::enqueue() and
 WP_Dependencies::dequeue() work in the same way.

 Not sure where the above example code comes from but it seems it needs to
 be:
 {{{
 foreach ( $wp_styles->registered AS $handle => $object )
   $wp_styles->remove($handle);
 }}}

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


More information about the wp-trac mailing list