diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
index 0938257da7..cc5072884a 100644
|
a
|
b
|
function media_send_to_editor( $html ) {
|
| 281 | 281 | * Saves a file submitted from a POST request and create an attachment post for it. |
| 282 | 282 | * |
| 283 | 283 | * @since 2.5.0 |
| | 284 | * @since 6.2.0 The `$post_id` parameter was made optional. |
| 284 | 285 | * |
| 285 | 286 | * @param string $file_id Index of the `$_FILES` array that the file was sent. |
| 286 | | * @param int $post_id The post ID of a post to attach the media item to. Required, but can |
| 287 | | * be set to 0, creating a media item that has no relationship to a post. |
| | 287 | * @param int $post_id Optional. The post ID of a post to attach the media item to. |
| | 288 | * If 0, creates a media item that has no relationship to a post. |
| | 289 | * Default 0. |
| 288 | 290 | * @param array $post_data Optional. Overwrite some of the attachment. |
| 289 | 291 | * @param array $overrides Optional. Override the wp_handle_upload() behavior. |
| 290 | 292 | * @return int|WP_Error ID of the attachment or a WP_Error object on failure. |
| 291 | 293 | */ |
| 292 | | function media_handle_upload( $file_id, $post_id, $post_data = array(), $overrides = array( 'test_form' => false ) ) { |
| | 294 | function media_handle_upload( $file_id, $post_id = 0, $post_data = array(), $overrides = array( 'test_form' => false ) ) { |
| 293 | 295 | $time = current_time( 'mysql' ); |
| 294 | 296 | $post = get_post( $post_id ); |
| 295 | 297 | |