add_action( 'delete_post', 'test_function' );

function test_function(){
    echo "Hello!";
}

The "Hello!" is not turning up after i remove a publish (It's a custom publish-type, but that should not matter right?). How do you debug this?

EDIT: I can not put that code in almost any front-finish files like header.php or index.php because I will not have the ability to see the output after i remove a publish in the back-finish. What's the easiest method to tackle this?

Thanks

Try doing the next to ascertain if you're reaching your filter. I examined this here with 3.2.1 and delay pills work acceptable for me.

function test_function(){
    die('deleted post');
}

this course of action won't run before you remove the publish in the trash. If you would like it to operate whenever you move it towards the trash the experience is 'trash_post'.