From 0d41ebae214ccad608f627a7d979946406156c05 Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@12882 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 )