WordPress.org

Make WordPress Core

Ticket #20810: wp_dropdown_pages_disabled_opt.patch

File wp_dropdown_pages_disabled_opt.patch, 1.0 KB (added by wpsmith, 9 years ago)

Disabled arg for wp_dropdown_pages()

  • post-template.php

     
    771771                'selected' => 0, 'echo' => 1,
    772772                'name' => 'page_id', 'id' => '',
    773773                'show_option_none' => '', 'show_option_no_change' => '',
    774                 'option_none_value' => ''
     774                'option_none_value' => '', 'disabled' => '',
    775775        );
    776776
    777777        $r = wp_parse_args( $args, $defaults );
     
    782782        // Back-compat with old system where both id and name were based on $name argument
    783783        if ( empty($id) )
    784784                $id = $name;
    785 
     785        $disabled_attribute = '';
     786        if( $disabled )
     787                $disabled_attribute = ' disabled="disabled"';
     788       
    786789        if ( ! empty($pages) ) {
    787                 $output = "<select name='" . esc_attr( $name ) . "' id='" . esc_attr( $id ) . "'>\n";
     790                $output = "<select name='" . esc_attr( $name ) . "' id='" . esc_attr( $id ) . "'$disabled_attribute>\n";
    788791                if ( $show_option_no_change )
    789792                        $output .= "\t<option value=\"-1\">$show_option_no_change</option>";
    790793                if ( $show_option_none )