WordPress.org

Make WordPress Core

Ticket #43579: 435791.patch

File 435791.patch, 2.0 KB (added by sebastian.pisula, 2 years ago)
  • wp-admin/includes/media.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    410410 * @since 2.6.0
    411411 *
    412412 * @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.
    414414 * @param string $desc       Optional. Description of the side-loaded file. Default null.
    415415 * @param array  $post_data  Optional. Post data to override. Default empty array.
    416416 * @return int|object The ID of the attachment or a WP_Error on failure.
    417417 */
    418 function media_handle_sideload( $file_array, $post_id, $desc = null, $post_data = array() ) {
     418function media_handle_sideload( $file_array, $post_id = null, $desc = null, $post_data = array() ) {
    419419        $overrides = array( 'test_form' => false );
    420420
    421421        $time = current_time( 'mysql' );
     
    913913 * @since 4.8.0 Introduced the 'id' option within the `$return` parameter.
    914914 *
    915915 * @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.
    917917 * @param string $desc    Optional. Description of the image.
    918918 * @param string $return  Optional. Accepts 'html' (image tag html) or 'src' (URL), or 'id' (attachment ID). Default 'html'.
    919919 * @return string|WP_Error Populated HTML img tag on success, WP_Error object otherwise.
    920920 */
    921 function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' ) {
     921function media_sideload_image( $file, $post_id = null, $desc = null, $return = 'html' ) {
    922922        if ( ! empty( $file ) ) {
    923923
    924924                // Set variables for storage, fix file filename for query strings.