[wp-trac] [WordPress Trac] #32991: wp_delete_post() does not return a WP_Post object

WordPress Trac noreply at wordpress.org
Tue Jul 14 09:55:22 UTC 2015


#32991: wp_delete_post() does not return a WP_Post object
--------------------------+------------------------------------------------
 Reporter:  johnbillion   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Posts, Post   |    Version:
  Types                   |   Keywords:  needs-docs needs-patch 2nd-opinion
 Severity:  normal        |
  Focuses:                |
--------------------------+------------------------------------------------
 The inline doc for `wp_delete_post()` states that it returns a `WP_Post`
 object, but it actually returns a `stdClass` object (the result of
 `$wpdb->get_row()`).

 There's most likely a reason that a raw SQL query is performed here rather
 than using `get_post()`. It would be interesting to know what that reason
 is, and to update the code or the docs accordingly.

 Anyone want to investigate?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32991>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list