mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Widgets: when passing a string arg value to dynamic_sidebar(), don't reset $index when the arg's sanitized value matches the sanitized name of a sidebar.
Adds unit test. Props tyxla, fjarrett. Fixes #23423. git-svn-id: https://develop.svn.wordpress.org/trunk@34465 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -293,4 +293,21 @@ class Tests_Widgets extends WP_UnitTestCase {
|
||||
$this->assertArrayNotHasKey( 2, $option_value );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 23423
|
||||
*/
|
||||
function test_dynamic_sidebar_id_special_characters() {
|
||||
wp_widgets_init();
|
||||
register_sidebar( array(
|
||||
'name' => 'Sidebar 2',
|
||||
'id' => 'sidebar-2',
|
||||
) );
|
||||
|
||||
ob_start();
|
||||
$result = dynamic_sidebar( 'Sidebar 1' );
|
||||
ob_end_clean();
|
||||
|
||||
$this->assertFalse( $result );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user