Created
February 3, 2020 01:33
-
-
Save BenBroide/17c7339fac3279d703d1abc410861ac7 to your computer and use it in GitHub Desktop.
wp delete post hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_delete_function($post_id) { | |
global $wpdb; | |
// our custom code with $post_id | |
} | |
// outisde a class | |
add_action( 'before_delete_post', 'my_delete_function' ); | |
// inside a class | |
add_action( 'before_delete_post', [ $this, 'my_delete_function' ] ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment