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

WordPress Trac noreply at wordpress.org
Wed Jan 20 04:39:40 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                                           |
-------------------------------------------------+-------------------------
Changes (by peterwilsoncc):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"49985" 49985]:
 {{{
 #!CommitTicketReference repository="" revision="49985"
 Media: Ensure `get_post_status()` returns correct result for attachments.

 Prevent `get_post_status()` returning `false` for attachments if the
 parent post has been deleted. The returned attachment post status is now
 passed through the `get_post_status` filter.

 Add tests for `get_post_status()`.

 Props peterwilsoncc, timothyblynjacobs for review.
 Fixes #52326.
 }}}

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


More information about the wp-trac mailing list