[wp-trac] [WordPress Trac] #52326: `get_post_status()` is can be incrorrect for attachments.

WordPress Trac noreply at wordpress.org
Wed Jan 20 17:53:39 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 joyously):

 > A valid attachment ID can no longer return false as the status
 > attachment with inherit status always inherits parent posts status
 unless trashed (need to confirm this is correct)
 > if the meta data is not set/the parent post does not exist the
 attachment defaults to publish

 `publish` seems like the wrong default for an attachment with no parent.
 Where is it published? I would suggest `draft` in this case.

 Is this marked for a dev note? There could be plugins checking for
 `false`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52326#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list