Make WordPress Core


Ignore:
Timestamp:
05/22/2019 09:47:49 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for the_date() and the_weekday_date().

Correct type for $currentday and $previousday globals.

See #47354, #47110.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r45340 r45377  
    23292329 * @since 0.71
    23302330 *
    2331  * @global string|int|bool $currentday
    2332  * @global string|int|bool $previousday
     2331 * @global string $currentday  The day of the current post in the loop.
     2332 * @global string $previousday The day of the previous post in the loop.
    23332333 *
    23342334 * @param string $d      Optional. PHP date format defaults to the date_format option if not specified.
     
    26762676 * @since 0.71
    26772677 *
    2678  * @global WP_Locale $wp_locale
     2678 * @global WP_Locale $wp_locale The WordPress date and time locale object.
    26792679 */
    26802680function the_weekday() {
    26812681    global $wp_locale;
     2682
    26822683    $the_weekday = $wp_locale->get_weekday( mysql2date( 'w', get_post()->post_date, false ) );
    26832684
     
    27002701 * @since 0.71
    27012702 *
    2702  * @global WP_Locale       $wp_locale
    2703  * @global string|int|bool $currentday
    2704  * @global string|int|bool $previousweekday
    2705  *
    2706  * @param string $before Optional Output before the date.
    2707  * @param string $after Optional Output after the date.
     2703 * @global WP_Locale $wp_locale       The WordPress date and time locale object.
     2704 * @global string    $currentday      The day of the current post in the loop.
     2705 * @global string    $previousweekday The day of the previous post in the loop.
     2706 *
     2707 * @param string $before Optional. Output before the date.
     2708 * @param string $after  Optional. Output after the date.
    27082709 */
    27092710function the_weekday_date( $before = '', $after = '' ) {
     
    27222723     * @since 0.71
    27232724     *
    2724      * @param string $the_weekday_date
     2725     * @param string $the_weekday_date The weekday on which the post was written.
    27252726     * @param string $before           The HTML to output before the date.
    27262727     * @param string $after            The HTML to output after the date.
Note: See TracChangeset for help on using the changeset viewer.