Make WordPress Core

Changeset 45377


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.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-query.php

    r45285 r45377  
    41704170     * @since 4.4.0 Added the ability to pass a post ID to `$post`.
    41714171     *
    4172      * @global int             $id
    4173      * @global WP_User         $authordata
    4174      * @global string|int|bool $currentday
    4175      * @global string|int|bool $currentmonth
    4176      * @global int             $page
    4177      * @global array           $pages
    4178      * @global int             $multipage
    4179      * @global int             $more
    4180      * @global int             $numpages
     4172     * @global int     $id
     4173     * @global WP_User $authordata
     4174     * @global string  $currentday
     4175     * @global string  $currentmonth
     4176     * @global int     $page
     4177     * @global array   $pages
     4178     * @global int     $multipage
     4179     * @global int     $more
     4180     * @global int     $numpages
    41814181     *
    41824182     * @param WP_Post|object|int $post WP_Post instance or Post ID/object.
  • 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.