Ticket #25889: 25889.patch
| File 25889.patch, 4.2 KB (added by , 13 years ago) |
|---|
-
wp-admin/includes/template.php
615 615 } 616 616 617 617 /** 618 * {@internal Missing Short Description}}618 * Print out html form date elements for editing post or comment publishing date 619 619 * 620 620 * @since 0.71 621 621 * 622 * @param unknown_type $edit623 * @param unknown_type $for_post624 * @param unknown_type $tab_index625 * @param unknown_type $multi622 * @param int|bool $edit (Optional) 1 - editing date, 0 - adding date 623 * @param int|bool $for_post (Optional) 1 - post, 0 - comment 624 * @param int|bool $tab_index (Optional) The tab index attribute to add 625 * @param int|bool $multi (Optional) Whether the additional fields and buttons should be added 626 626 */ 627 627 function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { 628 628 global $wp_locale, $comment; … … 655 655 $month = "<select " . ( $multi ? '' : 'id="mm" ' ) . "name=\"mm\"$tab_index_attribute>\n"; 656 656 for ( $i = 1; $i < 13; $i = $i +1 ) { 657 657 $monthnum = zeroise($i, 2); 658 $month .= "\t\t\t" . '<option value="' . $monthnum . '"'; 659 if ( $i == $mm ) 660 $month .= ' selected="selected"'; 658 $month .= "\t\t\t" . '<option value="' . $monthnum . '" ' . selected( $i, $mm, false ) . '>'; 661 659 /* translators: 1: month number (01, 02, etc.), 2: month abbreviation */ 662 $month .= '>' .sprintf( __( '%1$s-%2$s' ), $monthnum, $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ) ) . "</option>\n";660 $month .= sprintf( __( '%1$s-%2$s' ), $monthnum, $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ) ) . "</option>\n"; 663 661 } 664 662 $month .= '</select>'; 665 663 … … 680 678 foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) { 681 679 echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $$timeunit . '" />' . "\n"; 682 680 $cur_timeunit = 'cur_' . $timeunit; 683 echo '<input type="hidden" id="' . $cur_timeunit . '" name="'. $cur_timeunit . '" value="' . $$cur_timeunit . '" />' . "\n";681 echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $$cur_timeunit . '" />' . "\n"; 684 682 } 685 683 ?> 686 684 … … 692 690 } 693 691 694 692 /** 695 * {@internal Missing Short Description}}693 * Print out <option> html elements for page templates 696 694 * 697 695 * @since 1.5.0 698 696 * 699 * @param unknown_type $default697 * @param string $default (Optional) The template file name 700 698 */ 701 699 function page_template_dropdown( $default = '' ) { 702 700 $templates = get_page_templates(); 703 701 ksort( $templates ); 704 foreach (array_keys( $templates ) as $template ) 705 : if ( $default == $templates[$template] ) 706 $selected = " selected='selected'"; 707 else 708 $selected = ''; 709 echo "\n\t<option value='".$templates[$template]."' $selected>$template</option>"; 710 endforeach; 702 foreach ( array_keys( $templates ) as $template ) { 703 $selected = selected( $default, $templates[ $template ], false ); 704 echo "\n\t<option value='" . $templates[ $template ] . "' $selected>$template</option>"; 705 } 711 706 } 712 707 713 708 /** 714 * {@internal Missing Short Description}}709 * Print out <option> html elements for page parents 715 710 * 716 711 * @since 1.5.0 717 712 * 718 * @param unknown_type $default 719 * @param unknown_type $parent 720 * @param unknown_type $level 721 * @return unknown 713 * @param int $default (Optional) The default page ID to be pre selected 714 * @param int $parent (Optional) The parent page ID 715 * @param int $level (Optional) The depth level 716 * 717 * @return void|bool Boolean False if page has no children, otherwise print out html elements 722 718 */ 723 719 function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) { 724 720 global $wpdb; … … 732 728 continue; 733 729 734 730 $pad = str_repeat( ' ', $level * 3 ); 735 if ( $item->ID == $default) 736 $current = ' selected="selected"'; 737 else 738 $current = ''; 731 $selected = selected( $default, $item->ID, false ); 739 732 740 echo "\n\t<option class='level-$level' value='$item->ID' $current>$pad " . esc_html($item->post_title) . "</option>";733 echo "\n\t<option class='level-$level' value='$item->ID' $selected>$pad " . esc_html($item->post_title) . "</option>"; 741 734 parent_dropdown( $default, $item->ID, $level +1 ); 742 735 } 743 736 } else {
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)