[wp-trac] [WordPress Trac] #39521: media_handle_sideload does not initialize the caption/excerpt value

WordPress Trac noreply at wordpress.org
Mon Jan 9 02:58:06 UTC 2017


#39521: media_handle_sideload does not initialize the caption/excerpt value
--------------------------+-----------------------------
 Reporter:  dglingren     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In /wp-admin/includes/media.php changes have been made in the
 media_handle_upload() function to initialize the caption/excerpt value
 after an upload. Here's the code:

 {{{#!php
 <?php
         // Construct the attachment array
         $attachment = array_merge( array(
                 'post_mime_type' => $type,
                 'guid' => $url,
                 'post_parent' => $post_id,
                 'post_title' => $title,
                 'post_content' => $content,
                 'post_excerpt' => $excerpt,
         ), $post_data );
 }}}

 Corresponding changes should be made in the media_handle_sideload()
 function, which still has:

 {{{#!php
 <?php
         // Construct the attachment array.
         $attachment = array_merge( array(
                 'post_mime_type' => $type,
                 'guid' => $url,
                 'post_parent' => $post_id,
                 'post_title' => $title,
                 'post_content' => $content,
         ), $post_data )
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39521>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list