diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
index c6b2dcd..57fc0df 100644
a
|
b
|
function media_handle_upload($file_id, $post_id, $post_data = array(), $override |
385 | 385 | * @since 2.6.0 |
386 | 386 | * |
387 | 387 | * @param array $file_array Array similar to a `$_FILES` upload array. |
388 | | * @param int $post_id The post ID the media is associated with. |
| 388 | * @param int $post_id Optional. The post ID the media is associated with. |
389 | 389 | * @param string $desc Optional. Description of the side-loaded file. Default null. |
390 | 390 | * @param array $post_data Optional. Post data to override. Default empty array. |
391 | 391 | * @return int|object The ID of the attachment or a WP_Error on failure. |
392 | 392 | */ |
393 | | function media_handle_sideload( $file_array, $post_id, $desc = null, $post_data = array() ) { |
| 393 | function media_handle_sideload( $file_array, $post_id = 0, $desc = null, $post_data = array() ) { |
394 | 394 | $overrides = array('test_form'=>false); |
395 | 395 | |
396 | 396 | $time = current_time( 'mysql' ); |
397 | | if ( $post = get_post( $post_id ) ) { |
| 397 | if ( $post_id && $post = get_post( $post_id ) ) { |
398 | 398 | if ( substr( $post->post_date, 0, 4 ) > 0 ) |
399 | 399 | $time = $post->post_date; |
400 | 400 | } |