Make WordPress Core

Changeset 48929 for trunk


Ignore:
Timestamp:
09/01/2020 12:41:19 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Docs: Synchronize the description of the $format parameter in various date/time functions for posts and comments.

See #50768.

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

Legend:

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

    r48918 r48929  
    545545 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    546546 *
    547  * @param string         $format     Optional. The format of the date. Default user's setting.
     547 * @param string         $format     Optional. PHP date format. Defaults to the 'date_format' option.
    548548 * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to get the date.
    549549 *                                   Default current comment.
    … …  
    563563         *
    564564         * @param string|int $date    Formatted date string or Unix timestamp.
    565          * @param string     $format  The format of the date.
     565         * @param string     $format  PHP date format.
    566566         * @param WP_Comment $comment The comment object.
    567567         */
    … …  
    575575 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    576576 *
    577  * @param string         $format     Optional. The format of the date. Default user's settings.
     577 * @param string         $format     Optional. PHP date format. Defaults to the 'date_format' option.
    578578 * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the date.
    579579 *                                   Default current comment.
    … …  
    10341034 * @since 1.5.0
    10351035 *
    1036  * @param string $format    Optional. The format of the time. Default user's settings.
     1036 * @param string $format    Optional. PHP date format. Defaults to the 'time_format' option.
    10371037 * @param bool   $gmt       Optional. Whether to use the GMT date. Default false.
    10381038 * @param bool   $translate Optional. Whether to translate the time (for use in feeds).
    … …  
    10551055         *
    10561056         * @param string|int $date      The comment time, formatted as a date string or Unix timestamp.
    1057          * @param string     $format    Date format.
     1057         * @param string     $format    PHP date format.
    10581058         * @param bool       $gmt       Whether the GMT date is in use.
    10591059         * @param bool       $translate Whether the time is translated.
    … …  
    10681068 * @since 0.71
    10691069 *
    1070  * @param string $format Optional. The format of the time. Default user's settings.
     1070 * @param string $format Optional. PHP date format. Defaults to the 'time_format' option.
    10711071 */
    10721072function comment_time( $format = '' ) {
  • trunk/src/wp-includes/general-template.php

    r48918 r48929  
    24712471 * @global string $previousday The day of the previous post in the loop.
    24722472 *
    2473  * @param string $format Optional. PHP date format defaults to the date_format option if not specified.
    2474  * @param string $before Optional. Output before the date.
    2475  * @param string $after  Optional. Output after the date.
     2473 * @param string $format Optional. PHP date format. Defaults to the 'date_format' option.
     2474 * @param string $before Optional. Output before the date. Default empty.
     2475 * @param string $after  Optional. Output after the date. Default empty.
    24762476 * @param bool   $echo   Optional. Whether to echo the date or return it. Default true.
    24772477 * @return string|void String if retrieving.
    … …  
    24932493         *
    24942494         * @param string $the_date The formatted date string.
    2495          * @param string $format   PHP date format. Defaults to 'date_format' option
    2496          *                         if not specified.
     2495         * @param string $format   PHP date format.
    24972496         * @param string $before   HTML output before the date.
    24982497         * @param string $after    HTML output after the date.
    … …  
    25152514 * @since 3.0.0
    25162515 *
    2517  * @param string      $format Optional. PHP date format defaults to the date_format option if not specified.
     2516 * @param string      $format Optional. PHP date format. Defaults to the 'date_format' option.
    25182517 * @param int|WP_Post $post   Optional. Post ID or WP_Post object. Default current post.
    25192518 * @return string|false Date the current post was written. False on failure.
    … …  
    25362535         *
    25372536         * @param string      $the_date The formatted date.
    2538          * @param string      $format   PHP date format. Defaults to 'date_format' option
    2539          *                              if not specified.
     2537         * @param string      $format   PHP date format.
    25402538         * @param int|WP_Post $post     The post object or ID.
    25412539         */
    … …  
    25482546 * @since 2.1.0
    25492547 *
    2550  * @param string $format Optional. PHP date format defaults to the date_format option if not specified.
    2551  * @param string $before Optional. Output before the date.
    2552  * @param string $after  Optional. Output after the date.
     2548 * @param string $format Optional. PHP date format. Defaults to the 'date_format' option.
     2549 * @param string $before Optional. Output before the date. Default empty.
     2550 * @param string $after  Optional. Output after the date. Default empty.
    25532551 * @param bool   $echo   Optional. Whether to echo the date or return it. Default true.
    25542552 * @return string|void String if retrieving.
    … …  
    25622560         * @since 2.1.0
    25632561         *
    2564          * @param string $the_modified_date The last modified date.
    2565          * @param string $format            PHP date format. Defaults to 'date_format' option
    2566          *                                  if not specified.
    2567          * @param string $before            HTML output before the date.
    2568          * @param string $after             HTML output after the date.
     2562         * @param string|false $the_modified_date The last modified date or false if no post is found.
     2563         * @param string       $format            PHP date format.
     2564         * @param string       $before            HTML output before the date.
     2565         * @param string       $after             HTML output after the date.
    25692566         */
    25702567        $the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $format, $before, $after );
    … …  
    25842581 * @since 4.6.0 Added the `$post` parameter.
    25852582 *
    2586  * @param string      $format Optional. PHP date format defaults to the date_format option if not specified.
     2583 * @param string      $format Optional. PHP date format. Defaults to the 'date_format' option.
    25872584 * @param int|WP_Post $post   Optional. Post ID or WP_Post object. Default current post.
    25882585 * @return string|false Date the current post was modified. False on failure.
    … …  
    26062603         * @since 4.6.0 Added the `$post` parameter.
    26072604         *
    2608          * @param string|bool  $the_time The formatted date or false if no post is found.
    2609          * @param string       $format   PHP date format. Defaults to value specified in
    2610          *                               'date_format' option.
     2605         * @param string|false $the_time The formatted date or false if no post is found.
     2606         * @param string       $format   PHP date format.
    26112607         * @param WP_Post|null $post     WP_Post object or null if no post is found.
    26122608         */
    … …  
    26192615 * @since 0.71
    26202616 *
    2621  * @param string $format Either 'G', 'U', or PHP date format.
     2617 * @param string $format Optional. Format to use for retrieving the time the post
     2618 *                       was written. Accepts 'G', 'U', or PHP date format.
     2619 *                       Defaults to the 'time_format' option.
    26222620 */
    26232621function the_time( $format = '' ) {
    … …  
    26282626         *
    26292627         * @param string $get_the_time The formatted time.
    2630          * @param string $format       The time format. Accepts 'G', 'U',
    2631          *                             or PHP date format.
     2628         * @param string $format       Format to use for retrieving the time the post
     2629         *                             was written. Accepts 'G', 'U', or PHP date format.
    26322630         */
    26332631        echo apply_filters( 'the_time', get_the_time( $format ), $format );
    … …  
    26402638 *
    26412639 * @param string      $format Optional. Format to use for retrieving the time the post
    2642  *                            was written. Either 'G', 'U', or PHP date format defaults
    2643  *                            to the value specified in the time_format option. Default empty.
     2640 *                            was written. Accepts 'G', 'U', or PHP date format.
     2641 *                            Defaults to the 'time_format' option.
    26442642 * @param int|WP_Post $post   WP_Post object or ID. Default is global `$post` object.
    26452643 * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
    … …  
    26632661         *
    26642662         * @param string      $the_time The formatted time.
    2665          * @param string      $format   Format to use for retrieving the time the post was written.
    2666          *                              Accepts 'G', 'U', or PHP date format value specified
    2667          *                              in 'time_format' option. Default empty.
     2663         * @param string      $format   Format to use for retrieving the time the post
     2664         *                              was written. Accepts 'G', 'U', or PHP date format.
    26682665         * @param int|WP_Post $post     WP_Post object or ID.
    26692666         */
    … …  
    26772674 *
    26782675 * @param string      $format    Optional. Format to use for retrieving the time the post
    2679  *                               was written. Either 'G', 'U', or PHP date format. Default 'U'.
     2676 *                               was written. Accepts 'G', 'U', or PHP date format. Default 'U'.
    26802677 * @param bool        $gmt       Optional. Whether to retrieve the GMT time. Default false.
    26812678 * @param int|WP_Post $post      WP_Post object or ID. Default is global `$post` object.
    … …  
    28052802 * @since 2.0.0
    28062803 *
    2807  * @param string $format Optional. Either 'G', 'U', or PHP date format defaults
    2808  *                       to the value specified in the time_format option.
     2804 * @param string $format Optional. Format to use for retrieving the time the post
     2805 *                       was modified. Accepts 'G', 'U', or PHP date format.
     2806 *                       Defaults to the 'time_format' option.
    28092807 */
    28102808function the_modified_time( $format = '' ) {
    … …  
    28142812         * @since 2.0.0
    28152813         *
    2816          * @param string $get_the_modified_time The formatted time.
    2817          * @param string $format                The time format. Accepts 'G', 'U',
    2818          *                                      or PHP date format. Defaults to value
    2819          *                                      specified in 'time_format' option.
     2814         * @param string|false $get_the_modified_time The formatted time or false if no post is found.
     2815         * @param string       $format                Format to use for retrieving the time the post
     2816         *                                            was modified. Accepts 'G', 'U', or PHP date format.
    28202817         */
    28212818        echo apply_filters( 'the_modified_time', get_the_modified_time( $format ), $format );
    … …  
    28292826 *
    28302827 * @param string      $format Optional. Format to use for retrieving the time the post
    2831  *                            was modified. Either 'G', 'U', or PHP date format defaults
    2832  *                            to the value specified in the time_format option. Default empty.
     2828 *                            was modified. Accepts 'G', 'U', or PHP date format.
     2829 *                            Defaults to the 'time_format' option.
    28332830 * @param int|WP_Post $post   Optional. Post ID or WP_Post object. Default current post.
    28342831 * @return string|false Formatted date string or Unix timestamp. False on failure.
    … …  
    28522849         * @since 4.6.0 Added the `$post` parameter.
    28532850         *
    2854          * @param string|bool  $the_time The formatted time or false if no post is found.
    2855          * @param string       $format   Format to use for retrieving the time the post was
    2856          *                               written. Accepts 'G', 'U', or PHP date format. Defaults
    2857          *                               to value specified in 'time_format' option.
     2851         * @param string|false $the_time The formatted time or false if no post is found.
     2852         * @param string       $format   Format to use for retrieving the time the post
     2853         *                               was modified. Accepts 'G', 'U', or PHP date format.
    28582854         * @param WP_Post|null $post     WP_Post object or null if no post is found.
    28592855         */
    … …  
    28672863 *
    28682864 * @param string      $format    Optional. Format to use for retrieving the time the post
    2869  *                               was modified. Either 'G', 'U', or PHP date format. Default 'U'.
     2865 *                               was modified. Accepts 'G', 'U', or PHP date format. Default 'U'.
    28702866 * @param bool        $gmt       Optional. Whether to retrieve the GMT time. Default false.
    28712867 * @param int|WP_Post $post      WP_Post object or ID. Default is global `$post` object.
    … …  
    29582954 * @global string    $previousweekday The day of the previous post in the loop.
    29592955 *
    2960  * @param string $before Optional. Output before the date.
    2961  * @param string $after  Optional. Output after the date.
     2956 * @param string $before Optional. Output before the date. Default empty.
     2957 * @param string $after  Optional. Output after the date. Default empty.
    29622958 */
    29632959function the_weekday_date( $before = '', $after = '' ) {
Note: See TracChangeset for help on using the changeset viewer.