how to block the deletion of some posts
===

How to stop the cancellation of some posts.

I need to stop erasing and moving the trash of some posts of wordpress.

I tried with these features:

    add_action ('wp_trash_post', 'post_nel_cestino');
    
    post_nel_cestino function ($pid) {
    return false;
    }

But nothing happens, the posts are moved to the trash.

I tried to block the cancellation with these functions:

    add_action ('before_delete_post', 'non_eliminare');
    
    non_eliminare function ($pid) {
    return false;
    }

Also in this case nothing happens.