[wp-trac] [WordPress Trac] #31813: delete_post_{post_type}

WordPress Trac noreply at wordpress.org
Thu Oct 1 02:02:54 UTC 2015


#31813: delete_post_{post_type}
-------------------------------+---------------------------
 Reporter:  GunGeekATX         |       Owner:  DrewAPicture
     Type:  enhancement        |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:  wontfix
 Keywords:  has-patch          |     Focuses:
-------------------------------+---------------------------

Comment (by mattheweppelsheimer):

 FWIW you have persuaded me as well.

 johnbillion I hadn't seen that flaw in Scrubber, but now it's quite clear
 thanks to your analysis. It's also something I can address thanks to some
 tips from Drew in Slack.

 For anyone else who stumbles on this:

 {{{#!php
 add_action( ‘delete_post’, function() use ( $id ) {
     $post_type = get_post_type( $id );
     do_action( "delete_post_{$post_type}”, $id );
 } );
 }}}

 As drew said, "boom".

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


More information about the wp-trac mailing list