From b641ca55f57207b51a9912e073995369fe88a047 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 9 Jan 2015 05:04:59 +0000 Subject: [PATCH] Improve documentation for media_handle_upload(). props ericlewis. fixes #30962. git-svn-id: https://develop.svn.wordpress.org/trunk@31109 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/media.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index 599bff8862..737a3fc5f0 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -247,14 +247,15 @@ win.send_to_editor(''); } /** - * This handles the file upload POST itself, creating the attachment post. + * Save a file submitted from a POST request and create an attachment post for it. * * @since 2.5.0 * - * @param string $file_id Index into the {@link $_FILES} array of the upload - * @param int $post_id The post ID the media is associated with - * @param array $post_data allows you to overwrite some of the attachment - * @param array $overrides allows you to override the {@link wp_handle_upload()} behavior + * @param string $file_id Index of the {@link $_FILES} array that the file was sent. Required. + * @param int $post_id 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. + * @param array $post_data Overwrite some of the attachment. Optional. + * @param array $overrides Override the {@link wp_handle_upload()} behavior. Optional. * @return int|WP_Error ID of the attachment or a WP_Error object on failure. */ function media_handle_upload($file_id, $post_id, $post_data = array(), $overrides = array( 'test_form' => false )) {