Make WordPress Core


Ignore:
Timestamp:
07/01/2021 09:11:48 PM (4 years ago)
Author:
johnbillion
Message:

Docs: Descriptive improvements and corrections for various docblocks.

See #53399

File:
1 edited

Legend:

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

    r50979 r51300  
    734734 * @see wp_handle_upload_error
    735735 *
    736  * @param string[]       $file      Reference to a single element of `$_FILES`.
    737  *                                  Call the function once for each uploaded file.
    738  * @param array|false    $overrides {
     736 * @param array       $file      {
     737 *     Reference to a single element from `$_FILES`. Call the function once for each uploaded file.
     738 *
     739 *     @type string $name     The original name of the file on the client machine.
     740 *     @type string $type     The mime type of the file, if the browser provided this information.
     741 *     @type string $tmp_name The temporary filename of the file in which the uploaded file was stored on the server.
     742 *     @type int    $size     The size, in bytes, of the uploaded file.
     743 *     @type int    $error    The error code associated with this file upload.
     744 * }
     745 * @param array|false $overrides {
    739746 *     An array of override parameters for this file, or boolean false if none are provided.
    740747 *
     
    750757 *     @type string[] $mimes                    Array of allowed mime types keyed by their file extension regex.
    751758 * }
    752  * @param string         $time      Time formatted in 'yyyy/mm'.
    753  * @param string         $action    Expected value for `$_POST['action']`.
    754  * @return string[] On success, returns an associative array of file attributes.
    755  *                  On failure, returns `$overrides['upload_error_handler']( &$file, $message )`
    756  *                  or `array( 'error' => $message )`.
     759 * @param string      $time      Time formatted in 'yyyy/mm'.
     760 * @param string      $action    Expected value for `$_POST['action']`.
     761 * @return array {
     762 *     On success, returns an associative array of file attributes.
     763 *     On failure, returns `$overrides['upload_error_handler']( &$file, $message )`
     764 *     or `array( 'error' => $message )`.
     765 *
     766 *     @type string $file Filename of the newly-uploaded file.
     767 *     @type string $url  URL of the newly-uploaded file.
     768 *     @type string $type Mime type of the newly-uploaded file.
     769 * }
    757770 */
    758771function _wp_handle_upload( &$file, $overrides, $time, $action ) {
     
    777790     * @since 4.0.0 Converted to a dynamic hook with `$action`.
    778791     *
    779      * @param string[] $file An array of data for the file. Reference to a single element of `$_FILES`.
     792     * @param array $file {
     793     *     Reference to a single element from `$_FILES`.
     794     *
     795     *     @type string $name     The original name of the file on the client machine.
     796     *     @type string $type     The mime type of the file, if the browser provided this information.
     797     *     @type string $tmp_name The temporary filename of the file in which the uploaded file was stored on the server.
     798     *     @type int    $size     The size, in bytes, of the uploaded file.
     799     *     @type int    $error    The error code associated with this file upload.
     800     * }
    780801     */
    781802    $file = apply_filters( "{$action}_prefilter", $file );
     
    795816     * @param array|false $overrides An array of override parameters for this file. Boolean false if none are
    796817     *                               provided. @see _wp_handle_upload().
    797      * @param string[]    $file      An array of data for the file. Reference to a single element of `$_FILES`.
     818     * @param array       $file      {
     819     *     Reference to a single element from `$_FILES`.
     820     *
     821     *     @type string $name     The original name of the file on the client machine.
     822     *     @type string $type     The mime type of the file, if the browser provided this information.
     823     *     @type string $tmp_name The temporary filename of the file in which the uploaded file was stored on the server.
     824     *     @type int    $size     The size, in bytes, of the uploaded file.
     825     *     @type int    $error    The error code associated with this file upload.
     826     * }
    798827     */
    799828    $overrides = apply_filters( "{$action}_overrides", $overrides, $file );
     
    936965     *
    937966     * @param mixed    $move_new_file If null (default) move the file after the upload.
    938      * @param string[] $file          An array of data for a single file.
     967     * @param array    $file          {
     968     *     Reference to a single element from `$_FILES`.
     969     *
     970     *     @type string $name     The original name of the file on the client machine.
     971     *     @type string $type     The mime type of the file, if the browser provided this information.
     972     *     @type string $tmp_name The temporary filename of the file in which the uploaded file was stored on the server.
     973     *     @type int    $size     The size, in bytes, of the uploaded file.
     974     *     @type int    $error    The error code associated with this file upload.
     975     * }
    939976     * @param string   $new_file      Filename of the newly-uploaded file.
    940977     * @param string   $type          Mime type of the newly-uploaded file.
     
    10181055 * @param array       $file      Reference to a single element of `$_FILES`.
    10191056 *                               Call the function once for each uploaded file.
     1057 *                               See _wp_handle_upload() for accepted values.
    10201058 * @param array|false $overrides Optional. An associative array of names => values
    10211059 *                               to override default variables. Default false.
     1060 *                               See _wp_handle_upload() for accepted values.
    10221061 * @param string      $time      Optional. Time formatted in 'yyyy/mm'. Default null.
    1023  * @return array On success, returns an associative array of file attributes.
    1024  *               On failure, returns `$overrides['upload_error_handler']( &$file, $message )`
    1025  *               or `array( 'error' => $message )`.
     1062 * @return array See _wp_handle_upload() for return value.
    10261063 */
    10271064function wp_handle_upload( &$file, $overrides = false, $time = null ) {
     
    10491086 * @param array       $file      Reference to a single element of `$_FILES`.
    10501087 *                               Call the function once for each uploaded file.
     1088 *                               See _wp_handle_upload() for accepted values.
    10511089 * @param array|false $overrides Optional. An associative array of names => values
    10521090 *                               to override default variables. Default false.
     1091 *                               See _wp_handle_upload() for accepted values.
    10531092 * @param string      $time      Optional. Time formatted in 'yyyy/mm'. Default null.
    1054  * @return array On success, returns an associative array of file attributes.
    1055  *               On failure, returns `$overrides['upload_error_handler']( &$file, $message )`
    1056  *               or `array( 'error' => $message )`.
     1093 * @return array See _wp_handle_upload() for return value.
    10571094 */
    10581095function wp_handle_sideload( &$file, $overrides = false, $time = null ) {
Note: See TracChangeset for help on using the changeset viewer.