[wp-trac] [WordPress Trac] #42030: Introduce pre_trash_post filter

WordPress Trac noreply at wordpress.org
Fri Sep 29 10:45:59 UTC 2017


#42030: Introduce pre_trash_post filter
-------------------------------+-----------------------------
 Reporter:  bor0               |       Owner:  SergeyBiryukov
     Type:  enhancement        |      Status:  closed
 Priority:  normal             |   Milestone:  4.9
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:  fixed
 Keywords:  has-patch          |     Focuses:
-------------------------------+-----------------------------

Comment (by bor0):

 @SergeyBiryukov little nitpick, we use:
 `$post_trash = get_post( $id, ARRAY_A );` for `wp_trash_post`
 and
 `$post_delete = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM
 $wpdb->posts WHERE ID = %d", $id ) );` for `wp_delete_post`

 Thus, we have type `array` in `wp_trash_post`, and type `WP_Post` in
 `wp_delete_post`.

 I figured it would be easy to just improves the comment on the filter, but
 maybe even better to bring a little consistency between `wp_trash_post`
 and `wp_delete_post`.

 If you think the proposed patch has a high impact, we can just go ahead
 and update the filter comments on `wp_trash_post` and `wp_untrash_post` to
 say `array` instead of `WP_Post`.

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


More information about the wp-trac mailing list