From 1fbb89b1a061c8fac5629eebaa193170001d4cab Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 14 May 2007 05:13:39 +0000 Subject: [PATCH] Allow sidebar names to be passed to dynamic_sidebar(). fixes #4258 for 2.3 git-svn-id: http://svn.automattic.com/wordpress/trunk@5474 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/widgets.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index e7c0dc90d..830213bee 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -188,6 +188,12 @@ function dynamic_sidebar($index = 1) { $index = "sidebar-$index"; } else { $index = sanitize_title($index); + foreach ( $wp_registered_sidebars as $key => $value ) { + if ( sanitize_title($value['name']) == $index ) { + $index = $key; + break; + } + } } $sidebars_widgets = wp_get_sidebars_widgets();