WordPress.org

Make WordPress Core

Ticket #48164: 48164.diff

File 48164.diff, 870 bytes (added by dshanske, 15 months ago)
  • src/wp-admin/includes/media.php

    diff --git a/src/tags b/src/tags
    new file mode 100644
    index 0000000000..96da1e59b9
    Binary files /dev/null and b/src/tags differ
    diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
    index 5ca4197f1b..def421cf42 100644
    a b function media_sideload_image( $file, $post_id = 0, $desc = null, $return = 'htm 
    10021002                if ( is_wp_error( $id ) ) {
    10031003                        @unlink( $file_array['tmp_name'] );
    10041004                        return $id;
    1005                         // If attachment id was requested, return it early.
    1006                 } elseif ( $return === 'id' ) {
    1007                         return $id;
    10081005                }
    10091006
     1007                // Store the original attachment source in meta
     1008                add_post_meta( $id, '_source_url', $file );
     1009
     1010                // If attachment id was requested, return it.
     1011                if ( $return === 'id' ) {
     1012                        return $id;
     1013                }
    10101014                $src = wp_get_attachment_url( $id );
    10111015        }
    10121016