I've this course of actionOrconnect:

add_action( 'before_delete_post', 'my_delete_function' );
 function my_delete_function($post_id) { 
    global $wpdb;
    $achievement = get_the_category($post_id); 
    $h = $achievement[0]->cat_ID; 
    $s = ''.str_replace('"', '', $h);
   if ( $s == 6 || $s == 5){
        $wpdb->query("DELETE FROM wp_votes WHERE post = ".$post_id) or die(mysql_error());


The above mentioned is effective after i am removing posts in the admin. However, once the wordpress_remove_publish() is known as, the above mentioned function is not known as.

How do i result in the action use the remove function?

you need to pressure it to remove. otherwise the before_delete_post hook isn't performed.

 wp_delete_post( $postid, true);