Use wp_parse_args in register_sidebar. fixes #11836, props scribu.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3ca17b00ac
commit
a6d816df0b
|
@ -534,8 +534,6 @@ function register_sidebars($number = 1, $args = array()) {
|
||||||
*
|
*
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
* @uses $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
|
* @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
|
* @param string|array $args Builds Sidebar based off of 'name' and 'id' values
|
||||||
* @return string The sidebar id that was added.
|
* @return string The sidebar id that was added.
|
||||||
|
@ -543,9 +541,6 @@ function register_sidebars($number = 1, $args = array()) {
|
||||||
function register_sidebar($args = array()) {
|
function register_sidebar($args = array()) {
|
||||||
global $wp_registered_sidebars;
|
global $wp_registered_sidebars;
|
||||||
|
|
||||||
if ( is_string($args) )
|
|
||||||
parse_str($args, $args);
|
|
||||||
|
|
||||||
$i = count($wp_registered_sidebars) + 1;
|
$i = count($wp_registered_sidebars) + 1;
|
||||||
|
|
||||||
$defaults = array(
|
$defaults = array(
|
||||||
|
@ -558,7 +553,7 @@ function register_sidebar($args = array()) {
|
||||||
'after_title' => "</h2>\n",
|
'after_title' => "</h2>\n",
|
||||||
);
|
);
|
||||||
|
|
||||||
$sidebar = array_merge($defaults, (array) $args);
|
$sidebar = wp_parse_args( $args, $defaults );
|
||||||
|
|
||||||
$wp_registered_sidebars[$sidebar['id']] = $sidebar;
|
$wp_registered_sidebars[$sidebar['id']] = $sidebar;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue