Get rid of “trash can” for custom post type

If you wanted to do this for all post types, you’d simply do

define('EMPTY_TRASH_DAYS', 0);

see https://codex.wordpress.org/Trash_status#EMPTY_TRASH_DAYS_option.

But since you only want to do this for a custom post type, you will need to hook into ‘trashed_post’ like this:

add_action('trashed_post', function( $post_id ){ 
    [...]

then check your trashed posts’ post type:

    if ( get_post_type($post_id) === 'foo') {

and use wp_delete_post() with the ‘force delete’ parameter set to true on posts that turn out to be of your targeted post type:

        wp_delete_post( $post_id, true );
    }
});

I’d guess WordPress will then probably still show the ‘moved into trash bin’ message, even though it’ll appear to the user as if there was no trash bin and the post will indeed already be deleted entirely. So you might have to change the $labels that are passed to your register_post_type() call if that’s the case.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)