Change admin post thumbnail size for custom post type only

I want to change the size of the featued image for one custom post type only. This is what I currently have:

function custom_admin_thumb_size($thumb_size){

    global $post_type;
    if( 'slider' == $post_type ){

        return array(1000,400);

    }else{

        return array(266,266);
    }

}
add_filter( 'admin_post_thumbnail_size', 'custom_admin_thumb_size');

This function does what I expected but I was wondering if there is any better method to call the custom post type “slider” without touching the others.

Thanks in advance

Read more here: Change admin post thumbnail size for custom post type only

Leave a Reply

Your email address will not be published. Required fields are marked *