[wp-trac] [WordPress Trac] #17078: functions not compatible

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 7 15:06:17 UTC 2011


#17078: functions not compatible
--------------------------+------------------------------
 Reporter:  lanceo        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by kawauso):

 Using an integer breaks `dynamic_sidebar()` as well, so the sidebar would
 never be displayed anyway. Also noticed that even using a numeric string
 breaks a sidebar's widgets from being displayed in the dashboard, but does
 work with `dynamic_sidebar()` and related.

 Numeric sidebar IDs sound like bad practice too.

 '''Code to reproduce:'''

 {{{
 add_action( 'wp_head', 'sidebar_dump' );
 function sidebar_dump() {
         echo '<pre>';
         var_dump( wp_get_sidebars_widgets() );
         echo '</pre>';
 }

 add_action( 'wp_head', 'sidebar_display' );
 function sidebar_display() {
         echo '<pre>Sidebar integer: ';
         var_dump(dynamic_sidebar(5));
         echo 'Sidebar string: ';
         var_dump(dynamic_sidebar('6'));
         echo '</pre>';
 }

 register_sidebar( array(
     'id'          => 5,
     'name'        => 'Mambo No. 5',
     'description' => 'I break themes',
 ) );

 register_sidebar( array(
     'id'          => '6',
     'name'        => 'Mambo Number 6',
     'description' => 'I break themes',
 ) );
 }}}

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


More information about the wp-trac mailing list