[wp-trac] [WordPress Trac] #41070: register_sidebar and dynamic_sidebar inconsistency

WordPress Trac noreply at wordpress.org
Thu Jun 15 13:30:13 UTC 2017


#41070: register_sidebar and dynamic_sidebar inconsistency
-----------------------------+-----------------------------
 Reporter:  derkjanspeelman  |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Widgets          |    Version:  4.8
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Let's register a sidebar in functions.php and use digits for the value of
 the id key.

 {{{#!php
 <?php
 register_sidebar( array(
         'id'   => 'test123',
         // or 'id' => '123',
         // or 'id' => 123,
         'name' => 'test - Mega Menu',
 ) );
 }}}

 After that, the Widget is showing up at ''Appearance > Widgets''. But when
 we'd like to retrieve this widget using the dynamic_sidebar function, it
 won't work:

 {{{#!php
 <?php
 var_dump(dynamic_sidebar( 'test123' ));
 var_dump(dynamic_sidebar( '123' ));
 var_dump(dynamic_sidebar( 123 ));
 }}}

 All var_dumps will return ''bool(true)''

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41070>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list