[wp-trac] [WordPress Trac] #19629: return option for media_sideload_image

WordPress Trac wp-trac at lists.automattic.com
Sun Aug 5 20:16:59 UTC 2012


#19629: return option for media_sideload_image
-------------------------+------------------------------
 Reporter:  slbmeh       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Media        |     Version:  3.3
 Severity:  minor        |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------

Comment (by alexkingorg):

 Here is an alternative implementation. Instead of the additional arg to
 change the return, refactor the function into two functions. One returns
 the ID (more efficient, since if you just need the ID it doesn't need to
 call {{{wp_get_attachment_url()}}}, etc.), the other calls this function
 to get the ID and returns the HTML (maintains current behavior).

 Without this change, it is difficult to implement the following
 functionality while utilizing core functions:

 1. sideload an image
 2. set the image as the featured images for the post

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19629#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list