From 0b2eaf01c56e9d6eb9d29f810af16831e87ccf4c Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 27 Jan 2010 21:29:07 +0000 Subject: [PATCH] Add id arg to wp_dropdown_pages(). Props jeremyclarke. fixes #11433 git-svn-id: http://svn.automattic.com/wordpress/trunk@12882 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post-template.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 1644ce4c08..dbd3acce0a 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -691,7 +691,8 @@ function wp_dropdown_pages($args = '') { $defaults = array( 'depth' => 0, 'child_of' => 0, 'selected' => 0, 'echo' => 1, - 'name' => 'page_id', 'show_option_none' => '', 'show_option_no_change' => '', + 'name' => 'page_id', 'id' => '', + 'show_option_none' => '', 'show_option_no_change' => '', 'option_none_value' => '' ); @@ -701,9 +702,12 @@ function wp_dropdown_pages($args = '') { $pages = get_pages($r); $output = ''; $name = esc_attr($name); + // Back-compat with old system where both id and name were based on $name argument + if ( empty($id) ) + $id = $name; if ( ! empty($pages) ) { - $output = "\n"; if ( $show_option_no_change ) $output .= "\t"; if ( $show_option_none )