media_handle_sideload


media_handle_sideload ( $file_array, $post_id, $desc = null, $post_data = array() )

Parameters:
  • (array) $file_array Array similar to a `$_FILES` upload array.
  • (int) $post_id The post ID the media is associated with.
  • (string) $desc Optional. Description of the side-loaded file. Default null.
  • (array) $post_data Optional. Post data to override. Default empty array.
Returns:
  • (int|object) The ID of the attachment or a WP_Error on failure.
Defined at:

Description

Handles a side-loaded file in the same way as an uploaded file is handled by media_handle_upload().

Related Functions

media_handle_upload, wp_handle_sideload, wp_embed_handler_video, media_sideload_image, wp_handle_upload

Top Google Results

User discussions

wpseek mobile