Ticket #20810: wp_dropdown_pages_attr_opt.patch
File wp_dropdown_pages_attr_opt.patch, 1.1 KB (added by , 13 years ago) |
---|
-
post-template.php
771 771 'selected' => 0, 'echo' => 1, 772 772 'name' => 'page_id', 'id' => '', 773 773 'show_option_none' => '', 'show_option_no_change' => '', 774 'option_none_value' => '' 774 'option_none_value' => '', 'attr' => array(), 775 775 ); 776 776 777 777 $r = wp_parse_args( $args, $defaults ); … … 782 782 // Back-compat with old system where both id and name were based on $name argument 783 783 if ( empty($id) ) 784 784 $id = $name; 785 785 786 $attributes = ''; 787 foreach ( (array)$attr as $attr_name => $value ) { 788 $attributes .= " $attr_name=" . '"' . $value . '"'; 789 } 790 786 791 if ( ! empty($pages) ) { 787 $output = "<select name='" . esc_attr( $name ) . "' id='" . esc_attr( $id ) . "' >\n";792 $output = "<select name='" . esc_attr( $name ) . "' id='" . esc_attr( $id ) . "'$attributes>\n"; 788 793 if ( $show_option_no_change ) 789 794 $output .= "\t<option value=\"-1\">$show_option_no_change</option>"; 790 795 if ( $show_option_none )