WP_REST_Attachments_Controller::upload_from_file

SummerySummery

Handles an upload via multipart/form-data ($_FILES).

Syntax

WP_REST_Attachments_Controller::upload_from_file( array $files, array $headers )

ParametersParameters

$files

(array) (Required) Data from the $_FILES superglobal.

$headers

(array) (Required) HTTP headers from the request.

ReturnReturn

(array|WP_Error) Data from wp_handle_upload().

SourceSource

File: wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php


			

ChangelogChangelog

Changelog
Version Description
4.7.0 Introduced.
Scroll to Top