[wp-trac] [WordPress Trac] #16761: php notices with the_widget().

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 5 15:52:54 UTC 2011


#16761: php notices with the_widget().
--------------------------+-----------------------------
 Reporter:  mfields       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Widgets       |    Version:
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 the_widget() generates php notices when not passed $args and $instance
 parameters. To my knowledge these parameters are intended to be optional.
 To reproduce:

 1. Define WP_DEBUG as true in wp_config.php
 2. Please the following code in any template file in your active theme:


 {{{
 <?php
         the_widget( 'WP_Widget_Archives' );
         the_widget( 'WP_Widget_Calendar' );
         the_widget( 'WP_Widget_Categories' );
         the_widget( 'WP_Nav_Menu_Widget' );
         the_widget( 'WP_Widget_Links' );
         the_widget( 'WP_Widget_Meta' );
         the_widget( 'WP_Widget_Pages' );
         the_widget( 'WP_Widget_Recent_Comments' );
         the_widget( 'WP_Widget_Recent_Posts' );
         the_widget( 'WP_Widget_RSS' );
         the_widget( 'WP_Widget_Search' );
         the_widget( 'WP_Widget_Tag_Cloud' );
         the_widget( 'WP_Widget_Text' );
 ?>
 }}}

 I have attached a patch that I believe eliminates all notices. Please let
 me know your thoughts.

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


More information about the wp-trac mailing list