From 7369d040153ae195db66426b3ba0f6c3dedb57a0 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 18 Apr 2010 15:32:39 +0000 Subject: [PATCH] Use wp_parse_args in register_sidebar. fixes #11836, props scribu. git-svn-id: https://develop.svn.wordpress.org/trunk@14154 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/widgets.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 64b0dd6aec..3ecc523801 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -534,8 +534,6 @@ function register_sidebars($number = 1, $args = array()) { * * @since 2.2.0 * @uses $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID. - * @uses parse_str() Converts a string to an array to be used in the rest of the function. - * @usedby register_sidebars() * * @param string|array $args Builds Sidebar based off of 'name' and 'id' values * @return string The sidebar id that was added. @@ -543,9 +541,6 @@ function register_sidebars($number = 1, $args = array()) { function register_sidebar($args = array()) { global $wp_registered_sidebars; - if ( is_string($args) ) - parse_str($args, $args); - $i = count($wp_registered_sidebars) + 1; $defaults = array( @@ -558,7 +553,7 @@ function register_sidebar($args = array()) { 'after_title' => "\n", ); - $sidebar = array_merge($defaults, (array) $args); + $sidebar = wp_parse_args( $args, $defaults ); $wp_registered_sidebars[$sidebar['id']] = $sidebar;