From ca4045ce768fd5618a944e4d7eaaec48c49972c6 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 17 Feb 2014 22:27:15 +0000 Subject: [PATCH] Use `selected()` where appropriate in `touch_time()`, `page_template_dropdown()`, and `parent_dropdown()`. Also, add proper docs. Props meloniq, DrewAPicture. Fixes #25889. Built from https://develop.svn.wordpress.org/trunk@27188 git-svn-id: http://core.svn.wordpress.org/trunk@27047 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 52 +++++++++++++++------------------- wp-includes/link-template.php | 13 +++++++++ 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 6fba2219f9..ad1f7bcafb 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -615,14 +615,15 @@ function meta_form( $post = null ) { } /** - * {@internal Missing Short Description}} + * Print out HTML form date elements for editing post or comment publish date. * * @since 0.71 * - * @param unknown_type $edit - * @param unknown_type $for_post - * @param unknown_type $tab_index - * @param unknown_type $multi + * @param int|bool $edit Accepts 1|true for editing the date, 0|false for adding the date. + * @param int|bool $for_post Accepts 1|true for applying the date to a post, 0|false for a comment. + * @param int|bool $tab_index The tabindex attribute to add. Default 0. + * @param int|bool $multi Optional. Whether the additional fields and buttons should be added. + * Default 0|false. */ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { global $wp_locale, $comment; @@ -655,11 +656,9 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { $month = "'; @@ -680,7 +679,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) { echo '' . "\n"; $cur_timeunit = 'cur_' . $timeunit; - echo '' . "\n"; + echo '' . "\n"; } ?> @@ -692,33 +691,31 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { } /** - * {@internal Missing Short Description}} + * Print out "; - endforeach; + foreach ( array_keys( $templates ) as $template ) { + $selected = selected( $default, $templates[ $template ], false ); + echo "\n\t"; + } } /** - * {@internal Missing Short Description}} + * Print out "; + echo "\n\t"; parent_dropdown( $default, $item->ID, $level +1 ); } } else { diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index d6dae4876d..c3e7e69031 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -68,6 +68,19 @@ function permalink_anchor( $mode = 'id' ) { } } +/** + * Alias for get_permalink() + * + * @since 3.9.0 + * + * @param int|WP_Post $id Optional. Post ID or post object, defaults to the current post. + * @param bool $leavename Optional. Whether to keep post name or page name, defaults to false. + * @return string|bool The permalink URL or false if post does not exist. + */ +function get_the_permalink( $id = 0, $leavename = false ) { + return get_permalink( $id, $leavename ); +} + /** * Retrieve full permalink for current post or post ID. *