Is there a action hook for the “Empty Trash” button?
I don’t think there exist one, but you could create your own, wpse_empty_trash, with something like this: /** * Add a custom hook ‘wpse_empty_trash’ */ add_action( ‘load-edit.php’, function() { add_action( ‘before_delete_post’, function ( $post_id ) { if ( ‘trash’ === get_post_status( $post_id ) && filter_input( INPUT_GET, ‘delete_all’ ) && 1 === did_action( ‘before_delete_post ‘ ) … Read more