WordPress.org

Make WordPress Core

Changeset 14154


Ignore:
Timestamp:
04/18/10 15:32:39 (5 years ago)
Author:
nacin
Message:

Use wp_parse_args in register_sidebar. fixes #11836, props scribu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/widgets.php

    r13810 r14154  
    535535 * @since 2.2.0 
    536536 * @uses $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID. 
    537  * @uses parse_str() Converts a string to an array to be used in the rest of the function. 
    538  * @usedby register_sidebars() 
    539537 * 
    540538 * @param string|array $args Builds Sidebar based off of 'name' and 'id' values 
     
    543541function register_sidebar($args = array()) { 
    544542    global $wp_registered_sidebars; 
    545  
    546     if ( is_string($args) ) 
    547         parse_str($args, $args); 
    548543 
    549544    $i = count($wp_registered_sidebars) + 1; 
     
    559554    ); 
    560555 
    561     $sidebar = array_merge($defaults, (array) $args); 
     556    $sidebar = wp_parse_args( $args, $defaults ); 
    562557 
    563558    $wp_registered_sidebars[$sidebar['id']] = $sidebar; 
Note: See TracChangeset for help on using the changeset viewer.