Make WordPress Core


Ignore:
Timestamp:
02/21/2023 04:37:03 PM (19 months 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/functions.php

    r55344 r55398  
    10501050 * @param string       $sep       Optional. Argument separator; defaults to 'arg_separator.output'.
    10511051 *                                Default null.
    1052  * @param string       $key       Optional. Used to prefix key name. Default empty.
     1052 * @param string       $key       Optional. Used to prefix key name. Default empty string.
    10531053 * @param bool         $urlencode Optional. Whether to use urlencode() in the result. Default true.
    10541054 * @return string The query string.
     
    14391439 * @param int    $code        HTTP status code.
    14401440 * @param string $description Optional. A custom description for the HTTP status.
     1441 *                            Defaults to the result of get_status_header_desc() for the given code.
    14411442 */
    14421443function status_header( $code, $description = '' ) {
     
    30013002 * @param string   $filename File name or path.
    30023003 * @param string[] $mimes    Optional. Array of allowed mime types keyed by their file extension regex.
     3004 *                           Defaults to the result of get_allowed_mime_types().
    30033005 * @return array {
    30043006 *     Values for the extension and mime type.
     
    30433045 *                           in a tmp directory).
    30443046 * @param string[] $mimes    Optional. Array of allowed mime types keyed by their file extension regex.
     3047 *                           Defaults to the result of get_allowed_mime_types().
    30453048 * @return array {
    30463049 *     Values for the extension, mime type, and corrected filename.
     
    36193622 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
    36203623 *                                  and not an Ajax or XML-RPC request, the error's messages are used.
    3621  *                                  Default empty.
     3624 *                                  Default empty string.
    36223625 * @param string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
    36233626 *                                  error data with the key 'title' may be used to specify the title.
    3624  *                                  If `$title` is an integer, then it is treated as the response
    3625  *                                  code. Default empty.
     3627 *                                  If `$title` is an integer, then it is treated as the response code.
     3628 *                                  Default empty string.
    36263629 * @param string|array|int $args {
    36273630 *     Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
     
    37263729 *
    37273730 * @param string|WP_Error $message Error message or WP_Error object.
    3728  * @param string          $title   Optional. Error title. Default empty.
     3731 * @param string          $title   Optional. Error title. Default empty string.
    37293732 * @param string|array    $args    Optional. Arguments to control behavior. Default empty array.
    37303733 */
     
    39283931 *
    39293932 * @param string       $message Error message.
    3930  * @param string       $title   Optional. Error title (unused). Default empty.
     3933 * @param string       $title   Optional. Error title (unused). Default empty string.
    39313934 * @param string|array $args    Optional. Arguments to control behavior. Default empty array.
    39323935 */
     
    39703973 *
    39713974 * @param string       $message Error message.
    3972  * @param string       $title   Optional. Error title. Default empty.
     3975 * @param string       $title   Optional. Error title. Default empty string.
    39733976 * @param string|array $args    Optional. Arguments to control behavior. Default empty array.
    39743977 */
     
    40084011 *
    40094012 * @param string       $message Error message.
    4010  * @param string       $title   Optional. Error title. Default empty.
     4013 * @param string       $title   Optional. Error title. Default empty string.
    40114014 * @param string|array $args    Optional. Arguments to control behavior. Default empty array.
    40124015 */
     
    40524055 *
    40534056 * @param string       $message Error message.
    4054  * @param string       $title   Optional. Error title. Default empty.
     4057 * @param string       $title   Optional. Error title. Default empty string.
    40554058 * @param string|array $args    Optional. Arguments to control behavior. Default empty array.
    40564059 */
     
    40824085 *
    40834086 * @param string       $message Error message.
    4084  * @param string       $title   Optional. Error title. Default empty.
     4087 * @param string       $title   Optional. Error title. Default empty string.
    40854088 * @param string|array $args    Optional. Arguments to control behavior. Default empty array.
    40864089 */
     
    41264129 * @access private
    41274130 *
    4128  * @param string       $message Optional. Response to print. Default empty.
    4129  * @param string       $title   Optional. Error title (unused). Default empty.
     4131 * @param string       $message Optional. Response to print. Default empty string.
     4132 * @param string       $title   Optional. Error title (unused). Default empty string.
    41304133 * @param string|array $args    Optional. Arguments to control behavior. Default empty array.
    41314134 */
     
    41524155 *
    41534156 * @param string|WP_Error $message Error message or WP_Error object.
    4154  * @param string          $title   Optional. Error title. Default empty.
     4157 * @param string          $title   Optional. Error title. Default empty string.
    41554158 * @param string|array    $args    Optional. Arguments to control behavior. Default empty array.
    41564159 * @return array {
     
    45194522 *
    45204523 *     @type bool $associative Optional. When `true`, JSON objects will be returned as associative arrays.
    4521  *                             When `false`, JSON objects will be returned as objects.
     4524 *                             When `false`, JSON objects will be returned as objects. Default false.
    45224525 * }
    45234526 *
     
    53715374 * @param string $function_name The function that was called.
    53725375 * @param string $version       The version of WordPress that deprecated the function.
    5373  * @param string $replacement   Optional. The function that should have been called. Default empty.
     5376 * @param string $replacement   Optional. The function that should have been called. Default empty string.
    53745377 */
    53755378function _deprecated_function( $function_name, $version, $replacement = '' ) {
     
    55575560 * @param string $version     The version of WordPress that deprecated the file.
    55585561 * @param string $replacement Optional. The file that should have been included based on ABSPATH.
    5559  *                            Default empty.
    5560  * @param string $message     Optional. A message regarding the change. Default empty.
     5562 *                            Default empty string.
     5563 * @param string $message     Optional. A message regarding the change. Default empty string.
    55615564 */
    55625565function _deprecated_file( $file, $version, $replacement = '', $message = '' ) {
     
    56555658 * @param string $function_name The function that was called.
    56565659 * @param string $version       The version of WordPress that deprecated the argument used.
    5657  * @param string $message       Optional. A message regarding the change. Default empty.
     5660 * @param string $message       Optional. A message regarding the change. Default empty string.
    56585661 */
    56595662function _deprecated_argument( $function_name, $version, $message = '' ) {
     
    57435746 * @param string $hook        The hook that was used.
    57445747 * @param string $version     The version of WordPress that deprecated the hook.
    5745  * @param string $replacement Optional. The hook that should have been used. Default empty.
     5748 * @param string $replacement Optional. The hook that should have been used. Default empty string.
    57465749 * @param string $message     Optional. A message regarding the change. Default empty.
    57475750 */
     
    59875990 *
    59885991 * @param string   $file          File path.
    5989  * @param string[] $allowed_files Optional. Array of allowed files.
     5992 * @param string[] $allowed_files Optional. Array of allowed files. Default empty array.
    59905993 * @return int 0 means nothing is wrong, greater than 0 means something was wrong.
    59915994 */
     
    61056108 *
    61066109 * @param bool $suspend Optional. Suspends additions if true, re-enables them if false.
    6107  * @return bool The current suspend setting
     6110 *                      Defaults to not changing the current setting.
     6111 * @return bool The current suspend setting.
    61086112 */
    61096113function wp_suspend_cache_addition( $suspend = null ) {
     
    66366640 * @param array  $default_headers List of headers, in the format `array( 'HeaderKey' => 'Header Name' )`.
    66376641 * @param string $context         Optional. If specified adds filter hook {@see 'extra_$context_headers'}.
    6638  *                                Default empty.
     6642 *                                Default empty string.
    66396643 * @return string[] Array of file header values keyed by header name.
    66406644 */
     
    68106814 * @param int      $start         The ID to start the loop check at.
    68116815 * @param int      $start_parent  The parent_ID of $start to use instead of calling $callback( $start ).
    6812  *                                Use null to always use $callback
    6813  * @param array    $callback_args Optional. Additional arguments to send to $callback.
     6816 *                                Use null to always use $callback.
     6817 * @param array    $callback_args Optional. Additional arguments to send to $callback. Default empty array.
    68146818 * @return array IDs of all members of loop.
    68156819 */
     
    78147818 *
    78157819 * @param string $type The type of data to be anonymized.
    7816  * @param string $data Optional The data to be anonymized.
     7820 * @param string $data Optional. The data to be anonymized. Default empty string.
    78177821 * @return string The anonymous data for the requested type.
    78187822 */
     
    82478251 * @param string|string[] $exclude            Optional. Full path of a subdirectory to exclude from the total,
    82488252 *                                            or array of paths. Expected without trailing slash(es).
     8253 *                                            Default null.
    82498254 * @param int             $max_execution_time Optional. Maximum time to run before giving up. In seconds.
    82508255 *                                            The timeout is global and is measured from the moment
    8251  *                                            WordPress started to load.
     8256 *                                            WordPress started to load. Defaults to the value of
     8257 *                                            `max_execution_time` PHP setting.
    82528258 * @param array           $directory_cache    Optional. Array of cached directory paths.
     8259 *                                            Defaults to the value of `dirsize_cache` transient.
    82538260 * @return int|false|null Size in bytes if a valid directory. False if not. Null if timeout.
    82548261 */
Note: See TracChangeset for help on using the changeset viewer.