Make WordPress Core


Ignore:
Timestamp:
02/21/2023 04:37:03 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Document default values for optional parameters in various DocBlocks.

Props paulkevan, costdev, audrasjb, SergeyBiryukov.
See #56792.

File:
1 edited

Legend:

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

    r55369 r55398  
    156156 *
    157157 * @param int   $post_id The ID of the post.
    158  * @param array $args    Optional. See WP_Comment_Query::__construct() for information on accepted arguments.
     158 * @param array $args    {
     159 *     Optional. See WP_Comment_Query::__construct() for information on accepted arguments.
     160 *
     161 *     @type int    $status  Comment status to limit results by. Defaults to approved comments.
     162 *     @type int    $post_id Limit results to those affiliated with a given post ID.
     163 *     @type string $order   How to order retrieved comments. Default 'ASC'.
     164 * }
    159165 * @return WP_Comment[]|int[]|int The approved comments, or number of comments if `$count`
    160166 *                                argument is true.
     
    237243 *
    238244 * @param string|array $args Optional. Array or string of arguments. See WP_Comment_Query::__construct()
    239  *                           for information on accepted arguments. Default empty.
     245 *                           for information on accepted arguments. Default empty string.
    240246 * @return WP_Comment[]|int[]|int List of comments or number of found comments if `$count` argument is true.
    241247 */
     
    450456 * @param mixed  $meta_value Optional. Metadata value. If provided,
    451457 *                           rows will only be removed that match the value.
    452  *                           Must be serializable if non-scalar. Default empty.
     458 *                           Must be serializable if non-scalar. Default empty string.
    453459 * @return bool True on success, false on failure.
    454460 */
     
    466472 * @param int    $comment_id Comment ID.
    467473 * @param string $key        Optional. The meta key to retrieve. By default,
    468  *                           returns data for all keys.
     474 *                           returns data for all keys. Default empty string.
    469475 * @param bool   $single     Optional. Whether to return a single value.
    470476 *                           This parameter has no effect if `$key` is not specified.
     
    496502 * @param mixed  $prev_value Optional. Previous value to check before updating.
    497503 *                           If specified, only update existing metadata entries with
    498  *                           this value. Otherwise, update all entries. Default empty.
     504 *                           this value. Otherwise, update all entries. Default empty string.
    499505 * @return int|bool Meta ID if the key didn't exist, true on successful update,
    500506 *                  false on failure or if the value passed to the function
     
    986992 *
    987993 * @param WP_Comment[] $comments Optional. Array of WP_Comment objects. Defaults to `$wp_query->comments`.
    988  * @param int          $per_page Optional. Comments per page.
    989  * @param bool         $threaded Optional. Control over flat or threaded comments.
     994 * @param int          $per_page Optional. Comments per page. Defaults to the value of `comments_per_page`
     995 *                               query var, option of the same name, or 1 (in that order).
     996 * @param bool         $threaded Optional. Control over flat or threaded comments. Defaults to the value
     997 *                               of `thread_comments` option.
    990998 * @return int Number of comment pages.
    991999 */
Note: See TracChangeset for help on using the changeset viewer.