2020-05-02 / 5687阅 / 悠然
保存从POST请求提交的文件,并为其创建附件帖子。
(string)
(Required)
Index of the $_FILES array that the file was sent. Required.
(int)
(Required)
The post ID of a post to attach the media item to. Required, but can be set to 0, creating a media item that has no relationship to a post.
(array)
(Optional)
Overwrite some of the attachment. Optional.
Default value: array()
(array)
(Optional)
Override the wp_handle_upload() behavior. Optional.
Default value: array('test_form' => false)
(int|WP_Error) ID of the attachment or a WP_Error object on failure.