From 36df800c3c111580e7f274abc07ca31a03b2fc21 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 22 May 2019 21:47:49 +0000 Subject: [PATCH] Docs: Improve documentation for `the_date()` and `the_weekday_date()`. Correct type for `$currentday` and `$previousday` globals. See #47354, #47110. git-svn-id: https://develop.svn.wordpress.org/trunk@45377 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-query.php | 18 +++++++++--------- src/wp-includes/general-template.php | 19 ++++++++++--------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php index f1168504bb..97b7fc4155 100644 --- a/src/wp-includes/class-wp-query.php +++ b/src/wp-includes/class-wp-query.php @@ -4169,15 +4169,15 @@ class WP_Query { * @since 4.1.0 * @since 4.4.0 Added the ability to pass a post ID to `$post`. * - * @global int $id - * @global WP_User $authordata - * @global string|int|bool $currentday - * @global string|int|bool $currentmonth - * @global int $page - * @global array $pages - * @global int $multipage - * @global int $more - * @global int $numpages + * @global int $id + * @global WP_User $authordata + * @global string $currentday + * @global string $currentmonth + * @global int $page + * @global array $pages + * @global int $multipage + * @global int $more + * @global int $numpages * * @param WP_Post|object|int $post WP_Post instance or Post ID/object. * @return true True when finished. diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 8e8ab2012b..e956642b91 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -2328,8 +2328,8 @@ function the_date_xml() { * * @since 0.71 * - * @global string|int|bool $currentday - * @global string|int|bool $previousday + * @global string $currentday The day of the current post in the loop. + * @global string $previousday The day of the previous post in the loop. * * @param string $d Optional. PHP date format defaults to the date_format option if not specified. * @param string $before Optional. Output before the date. @@ -2675,10 +2675,11 @@ function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translat * * @since 0.71 * - * @global WP_Locale $wp_locale + * @global WP_Locale $wp_locale The WordPress date and time locale object. */ function the_weekday() { global $wp_locale; + $the_weekday = $wp_locale->get_weekday( mysql2date( 'w', get_post()->post_date, false ) ); /** @@ -2699,12 +2700,12 @@ function the_weekday() { * * @since 0.71 * - * @global WP_Locale $wp_locale - * @global string|int|bool $currentday - * @global string|int|bool $previousweekday + * @global WP_Locale $wp_locale The WordPress date and time locale object. + * @global string $currentday The day of the current post in the loop. + * @global string $previousweekday The day of the previous post in the loop. * - * @param string $before Optional Output before the date. - * @param string $after Optional Output after the date. + * @param string $before Optional. Output before the date. + * @param string $after Optional. Output after the date. */ function the_weekday_date( $before = '', $after = '' ) { global $wp_locale, $currentday, $previousweekday; @@ -2721,7 +2722,7 @@ function the_weekday_date( $before = '', $after = '' ) { * * @since 0.71 * - * @param string $the_weekday_date + * @param string $the_weekday_date The weekday on which the post was written. * @param string $before The HTML to output before the date. * @param string $after The HTML to output after the date. */