IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
410 | 410 | * @since 2.6.0 |
411 | 411 | * |
412 | 412 | * @param array $file_array Array similar to a `$_FILES` upload array. |
413 | | * @param int $post_id The post ID the media is associated with. |
| 413 | * @param int $post_id Optional. The post ID the media is associated with. |
414 | 414 | * @param string $desc Optional. Description of the side-loaded file. Default null. |
415 | 415 | * @param array $post_data Optional. Post data to override. Default empty array. |
416 | 416 | * @return int|object The ID of the attachment or a WP_Error on failure. |
417 | 417 | */ |
418 | | function media_handle_sideload( $file_array, $post_id, $desc = null, $post_data = array() ) { |
| 418 | function media_handle_sideload( $file_array, $post_id = null, $desc = null, $post_data = array() ) { |
419 | 419 | $overrides = array( 'test_form' => false ); |
420 | 420 | |
421 | 421 | $time = current_time( 'mysql' ); |
… |
… |
|
913 | 913 | * @since 4.8.0 Introduced the 'id' option within the `$return` parameter. |
914 | 914 | * |
915 | 915 | * @param string $file The URL of the image to download. |
916 | | * @param int $post_id The post ID the media is to be associated with. |
| 916 | * @param int $post_id Optional. The post ID the media is to be associated with. |
917 | 917 | * @param string $desc Optional. Description of the image. |
918 | 918 | * @param string $return Optional. Accepts 'html' (image tag html) or 'src' (URL), or 'id' (attachment ID). Default 'html'. |
919 | 919 | * @return string|WP_Error Populated HTML img tag on success, WP_Error object otherwise. |
920 | 920 | */ |
921 | | function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' ) { |
| 921 | function media_sideload_image( $file, $post_id = null, $desc = null, $return = 'html' ) { |
922 | 922 | if ( ! empty( $file ) ) { |
923 | 923 | |
924 | 924 | // Set variables for storage, fix file filename for query strings. |