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
This commit is contained in:
Sergey Biryukov 2019-05-22 21:47:49 +00:00
parent 1a1031b466
commit 36df800c3c
2 changed files with 19 additions and 18 deletions

View File

@ -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.

View File

@ -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.
*/