Make WordPress Core

Opened 15 years ago

Closed 9 years ago

#11993 closed enhancement (wontfix)

Add post thumbnail from url

Reported by: paradox460's profile paradox460 Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Post Thumbnails Keywords: needs-patch
Focuses: ui, administration Cc:

Description

If you got add a post thumbnail in 2.9, and use the "From URL" option, there is no link to set the image specified as the thumbnail. You can only put it in the post.

Change History (10)

#1 @scribu
15 years ago

  • Milestone changed from Unassigned to 3.0
  • Summary changed from When adding a post thumbnail from url, there is no option for setting the thumbnail to Add post thumbnail from url
  • Type changed from defect (bug) to enhancement

#2 @nacin
15 years ago

This is because we don't sideload the photo from a url and actually add it to the media library -- I'm a big fan of media_sideload_image() but we only use it in Press This.

#3 follow-up: @Paradox460
15 years ago

One thing that would be actually quite useful is the ability to specify a url, then have a "download to server" option, like MediaWiki provides.

I believe they just use CURL.

#4 in reply to: ↑ 3 @nacin
15 years ago

Replying to Paradox460:

One thing that would be actually quite useful is the ability to specify a url, then have a "download to server" option, like MediaWiki provides.

I believe they just use CURL.

We have a download_url() function that uses WP's HTTP API, which is used to download core/theme/plugin packages and in media_sideload_image(). media_sideload_image() is the ability you're looking for, though it is used only in Press This.

#5 @nacin
15 years ago

  • Milestone changed from 3.0 to 3.1

#6 @nacin
14 years ago

  • Milestone changed from Awaiting Triage to Future Release

#7 @lgedeon
12 years ago

media_sideload_image() can be extended to either:

  1. optionally return the attachment id (instead of html) so we can set_post_thumbnail( $post, $id ) with the results
  2. or we could include set_post_thumbnail( $post, $id ) in the function and add a boolean that says to make it the featured image
  3. or we could extract getting the attachment id into another function and make this function only responsible for building the html. Then if all I need is the id, I can call the extracted function instead.

I would love to write this patch, but would like to get your thoughts on preferred approach.

#8 @lgedeon
12 years ago

  • Cc luke.gedeon@… added

#9 @chriscct7
9 years ago

  • Focuses ui administration added
  • Keywords needs-patch added; thumbnail post removed
  • Version changed from 2.9.1 to 2.9

#10 @helen
9 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Feeling disinclined to do this - we don't sideload for insert from URL in other contexts, and relying on some other host for your featured images doesn't seem like a good thing to encourage.

Note: See TracTickets for help on using tickets.