diff --git a/wp-includes/template-functions-bookmarks.php b/wp-includes/template-functions-bookmarks.php index 9901ff9cf..71d1bf63c 100644 --- a/wp-includes/template-functions-bookmarks.php +++ b/wp-includes/template-functions-bookmarks.php @@ -250,7 +250,10 @@ function get_links_list($order = 'name', $hide_if_empty = 'obsolete') { function get_bookmarks($args = '') { global $wpdb; - parse_str($args, $r); + if ( is_array($args) ) + $r = &$args; + else + parse_str($args, $r); if ( !isset($r['orderby']) ) $r['orderby'] = 'name'; diff --git a/wp-includes/template-functions-category.php b/wp-includes/template-functions-category.php index 113c296ea..21840db9a 100644 --- a/wp-includes/template-functions-category.php +++ b/wp-includes/template-functions-category.php @@ -150,7 +150,11 @@ function category_description($category = 0) { } function wp_dropdown_categories($args = '') { - parse_str($args, $r); + if ( is_array($args) ) + $r = &$args; + else + parse_str($args, $r); + if ( !isset($r['show_option_all'])) $r['show_option_all'] = ''; if ( !isset($r['show_option_none'])) @@ -184,8 +188,7 @@ function wp_dropdown_categories($args = '') { extract($r); - $query = add_query_arg($r, ''); - $categories = get_categories($query); + $categories = get_categories($r); $output = ''; if ( ! empty($categories) ) { @@ -243,7 +246,11 @@ function wp_list_cats($args = '') { } function wp_list_categories($args = '') { - parse_str($args, $r); + if ( is_array($args) ) + $r = &$args; + else + parse_str($args, $r); + if ( !isset($r['optionall'])) $r['optionall'] = 0; if ( !isset($r['all'])) @@ -284,8 +291,7 @@ function wp_list_categories($args = '') { extract($r); - $query = add_query_arg($r, ''); - $categories = get_categories($query); + $categories = get_categories($r); $output = ''; if ( $title_li && $list ) @@ -425,7 +431,10 @@ function &_get_cat_children($category_id, $categories) { function &get_categories($args = '') { global $wpdb, $category_links; - parse_str($args, $r); + if ( is_array($args) ) + $r = &$args; + else + parse_str($args, $r); if ( !isset($r['type']) ) // 'post' or 'link' $r['type'] = 'post'; diff --git a/wp-includes/template-functions-post.php b/wp-includes/template-functions-post.php index 01cd9726f..51380e584 100644 --- a/wp-includes/template-functions-post.php +++ b/wp-includes/template-functions-post.php @@ -295,7 +295,11 @@ function &get_page_children($page_id, $pages) { function &get_pages($args = '') { global $wpdb; - parse_str($args, $r); + + if ( is_array($args) ) + $r = &$args; + else + parse_str($args, $r); if ( !isset($r['child_of']) ) $r['child_of'] = 0; @@ -335,7 +339,11 @@ function &get_pages($args = '') { } function wp_dropdown_pages($args = '') { - parse_str($args, $r); + if ( is_array($args) ) + $r = &$args; + else + parse_str($args, $r); + if ( !isset($r['depth']) ) $r['depth'] = 0; if ( !isset($r['child_of']) ) @@ -348,7 +356,7 @@ function wp_dropdown_pages($args = '') { $r['name'] = 'page_id'; extract($r); - $pages = get_pages($args); + $pages = get_pages($r); $output = ''; if ( ! empty($pages) ) { @@ -380,7 +388,11 @@ function _page_dropdown_element($output, $page, $depth, $selected) { } function wp_list_pages($args = '') { - parse_str($args, $r); + if ( is_array($args) ) + $r = &$args; + else + parse_str($args, $r); + if ( !isset($r['depth']) ) $r['depth'] = 0; if ( !isset($r['show_date']) ) @@ -397,7 +409,7 @@ function wp_list_pages($args = '') { $output = ''; // Query pages. - $pages = get_pages($args); + $pages = get_pages($r); if ( !empty($pages) ) { if ( $r['title_li'] )