WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 12 months ago

#38959 closed enhancement (duplicate)

Allow sideloading images without assigning to a post.

Reported by: dotancohen Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch needs-testing dev-feedback
Focuses: Cc:

Description (last modified by antpb)

Currently one cannot sideload an image without assigning it to a post. After careful review I see that this feature can be enabled in the current WordPress by simply providing a default Post ID of 0.

The attached post enables this feature.

In case one wonders what the use case is, consider that WordPress 4.x is no longer simply a blogging platform but now a full featured CMS with an expressive REST API that allows for very rapid development.

Attachments (1)

wordpress_38959.diff (1.2 KB) - added by dotancohen 3 years ago.
Patch to optionally allow a sideloaded media file to not be assigned to a particular post.

Download all attachments as: .zip

Change History (4)

@dotancohen
3 years ago

Patch to optionally allow a sideloaded media file to not be assigned to a particular post.

#1 @desrosj
13 months ago

  • Component changed from General to Media
  • Description modified (diff)
  • Keywords has-patch needs-testing dev-feedback added

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


12 months ago

#3 @antpb
12 months ago

  • Description modified (diff)
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @dotancohen , thank you so much for contributing this patch! The solution is very solid. This ticket was discussed in the most recent Media meeting and we agreed that this should move forward into the next release. The only tweak we'd suggest is instead of setting the post_id value to 0 it should maybe be set to null. In the process of discussing this ticket, we identified another trac ticket that almost identically solves this the way that you approached it, but with the null value instead of 0. #43579

We are going to close this ticket in favor of #43579 as it already has the change to null but I will make sure you both get props as you both have provided an excellent contribution. Thanks so much! if you have any other input, please feel free to jump into #43579 where we will be moving it forward.

Note: See TracTickets for help on using tickets.