[wp-trac] [WordPress Trac] #52326: `get_post_status()` is can be incrorrect for attachments.
WordPress Trac
noreply at wordpress.org
Wed Jan 20 21:58:50 UTC 2021
#52326: `get_post_status()` is can be incrorrect for attachments.
-------------------------------------------------+-------------------------
Reporter: peterwilsoncc | Owner:
| peterwilsoncc
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 5.7
Component: Media | Version: 2.2
Severity: normal | Resolution: fixed
Keywords: has-unit-tests has-patch needs-dev- | Focuses:
note |
-------------------------------------------------+-------------------------
Comment (by peterwilsoncc):
Replying to [comment:9 joyously]:
> `publish` seems like the wrong default for an attachment with no parent.
Where is it published? I would suggest `draft` in this case.
For `trash`ed parents, attachments have worked like this for a long time
(at least as far back as 4.4.0). An attachment uploaded with one post as
the parent may be published on another and WP Core offers no protections
against using files in the uploads folder.
> Is this marked for a dev note? There could be plugins checking for
`false`.
Yes, this is marked for a dev note.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52326#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list