WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#32695 closed enhancement (duplicate)

media_sideload_image should have option to return ID

Reported by: kraftbj Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: Media Keywords:
Focuses: Cc:

Description

media_sideload_image can either return the URL of the sideloaded image or a full HTML tag. It should have an option to return the attachment ID as well.

One use case is to sideload an image, then set it as a the post_thumbnail.

This is currently possible via media_handle_sideload but requires duplication of the work already being done in media_sideload_image.

Attachments (1)

32695.diff (1.0 KB) - added by kraftbj 5 years ago.
Adds new id return.

Download all attachments as: .zip

Change History (2)

@kraftbj
5 years ago

Adds new id return.

#1 @dd32
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Although a bit of a mess, see #19629

Note: See TracTickets for help on using tickets.