Changeset 46245
- Timestamp:
- 09/23/2019 04:02:38 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/media.php
r46174 r46245 433 433 * 434 434 * @since 2.6.0 435 * @since 5.3.0 Made `$post_id` parameter optional. 435 436 * 436 437 * @param array $file_array Array similar to a `$_FILES` upload array. 437 * @param int $post_id The post ID the media is associated with.438 * @param int $post_id Optional. The post ID the media is associated with. 438 439 * @param string $desc Optional. Description of the side-loaded file. Default null. 439 440 * @param array $post_data Optional. Post data to override. Default empty array. 440 441 * @return int|WP_Error The ID of the attachment or a WP_Error on failure. 441 442 */ 442 function media_handle_sideload( $file_array, $post_id , $desc = null, $post_data = array() ) {443 function media_handle_sideload( $file_array, $post_id = 0, $desc = null, $post_data = array() ) { 443 444 $overrides = array( 'test_form' => false ); 444 445 … … 970 971 * @since 4.2.0 Introduced the `$return` parameter. 971 972 * @since 4.8.0 Introduced the 'id' option within the `$return` parameter. 973 * @since 5.3.0 Made the `$post_id` parameter optional 972 974 * 973 975 * @param string $file The URL of the image to download. 974 * @param int $post_id The post ID the media is to be associated with.976 * @param int $post_id Optional. The post ID the media is to be associated with. 975 977 * @param string $desc Optional. Description of the image. 976 978 * @param string $return Optional. Accepts 'html' (image tag html) or 'src' (URL), or 'id' (attachment ID). Default 'html'. 977 979 * @return string|WP_Error Populated HTML img tag on success, WP_Error object otherwise. 978 980 */ 979 function media_sideload_image( $file, $post_id , $desc = null, $return = 'html' ) {981 function media_sideload_image( $file, $post_id = 0, $desc = null, $return = 'html' ) { 980 982 if ( ! empty( $file ) ) { 981 983
Note: See TracChangeset
for help on using the changeset viewer.