check if custom post type exists

PHP
post_exists(get_the_title($postID), '', '', $slug_post_type); //Returns $postID or 0
Source

Also in PHP: