diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index 194e827..e0aa97d 100644
a
|
b
|
function wp_media_upload_handler() { |
846 | 846 | * @param string $file The URL of the image to download. |
847 | 847 | * @param int $post_id The post ID the media is to be associated with. |
848 | 848 | * @param string $desc Optional. Description of the image. |
849 | | * @param string $return Optional. Accepts 'html' (image tag html) or 'src' (URL). Default 'html'. |
| 849 | * @param string $return Optional. Accepts 'html' (image tag html) or 'src' (URL), or 'id' (attachment ID). Default 'html'. |
850 | 850 | * @return string|WP_Error Populated HTML img tag on success, WP_Error object otherwise. |
851 | 851 | */ |
852 | 852 | function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' ) { |
… |
… |
function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' ) |
872 | 872 | // Do the validation and storage stuff. |
873 | 873 | $id = media_handle_sideload( $file_array, $post_id, $desc ); |
874 | 874 | |
| 875 | // If we want a simple out to get to the image ID, make it available here. |
| 876 | if ( $return === 'id' ) { |
| 877 | return $id; |
| 878 | } |
| 879 | |
875 | 880 | // If error storing permanently, unlink. |
876 | 881 | if ( is_wp_error( $id ) ) { |
877 | 882 | @unlink( $file_array['tmp_name'] ); |