[wp-trac] [WordPress Trac] #41977: media_handle_upload() un required second parameter
WordPress Trac
noreply at wordpress.org
Fri Jan 27 23:07:40 UTC 2023
#41977: media_handle_upload() un required second parameter
-------------------------+-----------------------
Reporter: Tkama | Owner: antpb
Type: enhancement | Status: assigned
Priority: normal | Milestone: 6.2
Component: Media | Version: 2.5
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+-----------------------
Comment (by azaozz):
Replying to [comment:3 antpb]:
> This change should save a developer from having to read the docs...
Actually I tend to agree with @desrosj
[https://core.trac.wordpress.org/ticket/41977?replyto=3#comment:1 comment]
from 4 years ago:
requiring the parameter also requires the developer to make a conscious
decision about where the image should be attached
WP adds context to images and other uploads by saving the post they were
uploaded to. This context can be used for many things like permission
settings, etc.
Imho would be nice to remind developers to add the post_ID for new uploads
if possible.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41977#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list