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

WordPress Trac noreply at wordpress.org
Tue Jan 19 23:37:29 UTC 2021


#52326: `get_post_status()` is can be incrorrect for attachments.
--------------------------------------+------------------------------
 Reporter:  peterwilsoncc             |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Media                     |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-unit-tests has-patch  |     Focuses:
--------------------------------------+------------------------------

Comment (by peterwilsoncc):

 In [https://github.com/WordPress/wordpress-develop/pull/881 PR #881]:

 * Unit tests
 * 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)
 * trashed posts return the status immediately prior to the post been
 trashed using the meta data
 * if the meta data is not set/the parent post does not exist the
 attachment defaults to `publish`.
 * attachments are now passed through the `get_post_status` filter, they
 bypassed it before.

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


More information about the wp-trac mailing list