Make WordPress Core

Changeset 54958


Ignore:
Timestamp:
12/12/2022 11:49:40 AM (15 months ago)
Author:
SergeyBiryukov
Message:

Docs: Mark some optional parameters as such in wp-includes/comment-template.php.

This affects:

  • get_comment_class()
  • comment_class()
  • get_comment_excerpt()
  • comment_excerpt()
  • get_comment_link()
  • get_comment_text()
  • comment_text()
  • comments_open()
  • pings_open()
  • get_comment_reply_link()
  • comment_reply_link()
  • post_reply_link()
  • comment_form()

Follow-up to [25567], [27156], [33961].

See #56792.

File:
1 edited

Legend:

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

    r54891 r54958  
    426426 * @param string|string[] $css_class Optional. One or more classes to add to the class list.
    427427 *                                   Default empty.
    428  * @param int|WP_Comment  $comment   Comment ID or WP_Comment object. Default current comment.
    429  * @param int|WP_Post     $post      Post ID or WP_Post object. Default current post.
     428 * @param int|WP_Comment  $comment   Optional. Comment ID or WP_Comment object. Default current comment.
     429 * @param int|WP_Post     $post      Optional. Post ID or WP_Post object. Default current post.
    430430 * @param bool            $display   Optional. Whether to print or return the output.
    431431 *                                   Default true.
     
    453453 * @global int $comment_thread_alt
    454454 *
    455  * @param string|string[] $css_class  Optional. One or more classes to add to the class list. Default empty.
    456  * @param int|WP_Comment  $comment_id Comment ID or WP_Comment object. Default current comment.
    457  * @param int|WP_Post     $post       Post ID or WP_Post object. Default current post.
     455 * @param string|string[] $css_class  Optional. One or more classes to add to the class list.
     456 *                                    Default empty.
     457 * @param int|WP_Comment  $comment_id Optional. Comment ID or WP_Comment object. Default current comment.
     458 * @param int|WP_Post     $post       Optional. Post ID or WP_Post object. Default current post.
    458459 * @return string[] An array of classes.
    459460 */
     
    592593 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    593594 *
    594  * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to get the excerpt.
    595  *                                    Default current comment.
     595 * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the excerpt.
     596 *                                   Default current comment.
    596597 * @return string The possibly truncated comment excerpt.
    597598 */
     
    638639 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
    639640 *
    640  * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the excerpt.
    641  *                                    Default current comment.
     641 * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to print the excerpt.
     642 *                                   Default current comment.
    642643 */
    643644function comment_excerpt( $comment_ID = 0 ) {
     
    700701 * @global bool       $in_comment_loop
    701702 *
    702  * @param WP_Comment|int|null $comment Comment to retrieve. Default current comment.
     703 * @param WP_Comment|int|null $comment Optional. Comment to retrieve. Default current comment.
    703704 * @param array               $args {
    704705 *     An array of optional arguments to override the defaults.
     
    959960 * @see Walker_Comment::comment()
    960961 *
    961  * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to get the text.
     962 * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the text.
    962963 *                                   Default current comment.
    963964 * @param array          $args       Optional. An array of arguments. Default empty array.
     
    10051006 * @see Walker_Comment::comment()
    10061007 *
    1007  * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the text.
     1008 * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to print the text.
    10081009 *                                   Default current comment.
    10091010 * @param array          $args       Optional. An array of arguments. Default empty array.
     
    12321233 * @since 1.5.0
    12331234 *
    1234  * @param int|WP_Post $post Post ID or WP_Post object. Default current post.
     1235 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post.
    12351236 * @return bool True if the comments are open.
    12361237 */
     
    12611262 * @since 1.5.0
    12621263 *
    1263  * @param int|WP_Post $post Post ID or WP_Post object. Default current post.
     1264 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post.
    12641265 * @return bool True if pings are accepted
    12651266 */
     
    16621663 *     @type string $after      The text or HTML to add after the reply link. Default empty.
    16631664 * }
    1664  * @param int|WP_Comment $comment Comment being replied to. Default current comment.
    1665  * @param int|WP_Post    $post    Post ID or WP_Post object the comment is going to be displayed on.
     1665 * @param int|WP_Comment $comment Optional. Comment being replied to. Default current comment.
     1666 * @param int|WP_Post    $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
    16661667 *                                Default current post.
    16671668 * @return string|false|null Link to show comment form, if successful. False, if comments are closed.
     
    17831784 *
    17841785 * @param array          $args    Optional. Override default options. Default empty array.
    1785  * @param int|WP_Comment $comment Comment being replied to. Default current comment.
    1786  * @param int|WP_Post    $post    Post ID or WP_Post object the comment is going to be displayed on.
     1786 * @param int|WP_Comment $comment Optional. Comment being replied to. Default current comment.
     1787 * @param int|WP_Post    $post    Optional. Post ID or WP_Post object the comment is going to be displayed on.
    17871788 *                                Default current post.
    17881789 */
     
    18741875 *
    18751876 * @param array       $args Optional. Override default options. Default empty array.
    1876  * @param int|WP_Post $post Post ID or WP_Post object the comment is going to be displayed on.
     1877 * @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on.
    18771878 *                          Default current post.
    18781879 */
     
    23202321 *     @type string $format               The comment form format. Default 'xhtml'. Accepts 'xhtml', 'html5'.
    23212322 * }
    2322  * @param int|WP_Post $post Post ID or WP_Post object to generate the form for. Default current post.
     2323 * @param int|WP_Post $post Optional. Post ID or WP_Post object to generate the form for. Default current post.
    23232324 */
    23242325function comment_form( $args = array(), $post = null ) {
Note: See TracChangeset for help on using the changeset viewer.