Changeset 27188
- Timestamp:
- 02/17/2014 10:26:14 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/template.php
r27137 r27188 616 616 617 617 /** 618 * {@internal Missing Short Description}}618 * Print out HTML form date elements for editing post or comment publish date. 619 619 * 620 620 * @since 0.71 621 621 * 622 * @param unknown_type $edit 623 * @param unknown_type $for_post 624 * @param unknown_type $tab_index 625 * @param unknown_type $multi 622 * @param int|bool $edit Accepts 1|true for editing the date, 0|false for adding the date. 623 * @param int|bool $for_post Accepts 1|true for applying the date to a post, 0|false for a comment. 624 * @param int|bool $tab_index The tabindex attribute to add. Default 0. 625 * @param int|bool $multi Optional. Whether the additional fields and buttons should be added. 626 * Default 0|false. 626 627 */ 627 628 function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { … … 656 657 for ( $i = 1; $i < 13; $i = $i +1 ) { 657 658 $monthnum = zeroise($i, 2); 658 $month .= "\t\t\t" . '<option value="' . $monthnum . '"'; 659 if ( $i == $mm ) 660 $month .= ' selected="selected"'; 659 $month .= "\t\t\t" . '<option value="' . $monthnum . '" ' . selected( $i, $mm, false ) . '>'; 661 660 /* 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";661 $month .= sprintf( __( '%1$s-%2$s' ), $monthnum, $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ) ) . "</option>\n"; 663 662 } 664 663 $month .= '</select>'; … … 681 680 echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $$timeunit . '" />' . "\n"; 682 681 $cur_timeunit = 'cur_' . $timeunit; 683 echo '<input type="hidden" id="' . $cur_timeunit . '" name="'. $cur_timeunit . '" value="' . $$cur_timeunit . '" />' . "\n";682 echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $$cur_timeunit . '" />' . "\n"; 684 683 } 685 684 ?> … … 693 692 694 693 /** 695 * {@internal Missing Short Description}}694 * Print out <option> HTML elements for the page templates drop-down. 696 695 * 697 696 * @since 1.5.0 698 697 * 699 * @param unknown_type $default698 * @param string $default Optional. The template file name. Default empty. 700 699 */ 701 700 function page_template_dropdown( $default = '' ) { 702 701 $templates = get_page_templates(); 703 702 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; 711 } 712 713 /** 714 * {@internal Missing Short Description}} 703 foreach ( array_keys( $templates ) as $template ) { 704 $selected = selected( $default, $templates[ $template ], false ); 705 echo "\n\t<option value='" . $templates[ $template ] . "' $selected>$template</option>"; 706 } 707 } 708 709 /** 710 * Print out <option> HTML elements for the page parents drop-down. 715 711 * 716 712 * @since 1.5.0 717 713 * 718 * @param unknown_type $default 719 * @param unknown_type $parent 720 * @param unknown_type $level 721 * @return unknown 714 * @param int $default Optional. The default page ID to be pre-selected. Default 0. 715 * @param int $parent Optional. The parent page ID. Default 0. 716 * @param int $level Optional. Page depth level. Default 0. 717 * 718 * @return void|bool Boolean False if page has no children, otherwise print out html elements 722 719 */ 723 720 function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) { … … 733 730 734 731 $pad = str_repeat( ' ', $level * 3 ); 735 if ( $item->ID == $default) 736 $current = ' selected="selected"'; 737 else 738 $current = ''; 739 740 echo "\n\t<option class='level-$level' value='$item->ID'$current>$pad " . esc_html($item->post_title) . "</option>"; 732 $selected = selected( $default, $item->ID, false ); 733 734 echo "\n\t<option class='level-$level' value='$item->ID' $selected>$pad " . esc_html($item->post_title) . "</option>"; 741 735 parent_dropdown( $default, $item->ID, $level +1 ); 742 736 } -
trunk/src/wp-includes/link-template.php
r27026 r27188 67 67 break; 68 68 } 69 } 70 71 /** 72 * Alias for get_permalink() 73 * 74 * @since 3.9.0 75 * 76 * @param int|WP_Post $id Optional. Post ID or post object, defaults to the current post. 77 * @param bool $leavename Optional. Whether to keep post name or page name, defaults to false. 78 * @return string|bool The permalink URL or false if post does not exist. 79 */ 80 function get_the_permalink( $id = 0, $leavename = false ) { 81 return get_permalink( $id, $leavename ); 69 82 } 70 83
Note: See TracChangeset
for help on using the changeset viewer.