Changeset 51300 for trunk/src/wp-admin/includes/file.php
- Timestamp:
- 07/01/2021 09:11:48 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r50979 r51300 734 734 * @see wp_handle_upload_error 735 735 * 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 { 739 746 * An array of override parameters for this file, or boolean false if none are provided. 740 747 * … … 750 757 * @type string[] $mimes Array of allowed mime types keyed by their file extension regex. 751 758 * } 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 * } 757 770 */ 758 771 function _wp_handle_upload( &$file, $overrides, $time, $action ) { … … 777 790 * @since 4.0.0 Converted to a dynamic hook with `$action`. 778 791 * 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 * } 780 801 */ 781 802 $file = apply_filters( "{$action}_prefilter", $file ); … … 795 816 * @param array|false $overrides An array of override parameters for this file. Boolean false if none are 796 817 * 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 * } 798 827 */ 799 828 $overrides = apply_filters( "{$action}_overrides", $overrides, $file ); … … 936 965 * 937 966 * @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 * } 939 976 * @param string $new_file Filename of the newly-uploaded file. 940 977 * @param string $type Mime type of the newly-uploaded file. … … 1018 1055 * @param array $file Reference to a single element of `$_FILES`. 1019 1056 * Call the function once for each uploaded file. 1057 * See _wp_handle_upload() for accepted values. 1020 1058 * @param array|false $overrides Optional. An associative array of names => values 1021 1059 * to override default variables. Default false. 1060 * See _wp_handle_upload() for accepted values. 1022 1061 * @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. 1026 1063 */ 1027 1064 function wp_handle_upload( &$file, $overrides = false, $time = null ) { … … 1049 1086 * @param array $file Reference to a single element of `$_FILES`. 1050 1087 * Call the function once for each uploaded file. 1088 * See _wp_handle_upload() for accepted values. 1051 1089 * @param array|false $overrides Optional. An associative array of names => values 1052 1090 * to override default variables. Default false. 1091 * See _wp_handle_upload() for accepted values. 1053 1092 * @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. 1057 1094 */ 1058 1095 function wp_handle_sideload( &$file, $overrides = false, $time = null ) {
Note: See TracChangeset
for help on using the changeset viewer.