Make WordPress Core

Changeset 12882


Ignore:
Timestamp:
01/27/2010 09:29:07 PM (15 years ago)
Author:
ryan
Message:

Add id arg to wp_dropdown_pages(). Props jeremyclarke. fixes #11433

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r12877 r12882  
    692692        'depth' => 0, 'child_of' => 0,
    693693        'selected' => 0, 'echo' => 1,
    694         'name' => 'page_id', 'show_option_none' => '', 'show_option_no_change' => '',
     694        'name' => 'page_id', 'id' => '',
     695        'show_option_none' => '', 'show_option_no_change' => '',
    695696        'option_none_value' => ''
    696697    );
     
    702703    $output = '';
    703704    $name = esc_attr($name);
     705    // Back-compat with old system where both id and name were based on $name argument
     706    if ( empty($id) )
     707        $id = $name;
    704708
    705709    if ( ! empty($pages) ) {
    706         $output = "<select name=\"$name\" id=\"$name\">\n";
     710        $output = "<select name=\"$name\" id=\"$id\">\n";
    707711        if ( $show_option_no_change )
    708712            $output .= "\t<option value=\"-1\">$show_option_no_change</option>";
Note: See TracChangeset for help on using the changeset viewer.