diff --git a/wp-includes/post.php b/wp-includes/post.php
index bb7e37a..8592c1f 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -1665,12 +1665,20 @@ function set_post_type( $post_id = 0, $post_type = 'post' ) {
  * For all others, the 'publicly_queryable' value will be used.
  *
  * @since 4.4.0
+ * @since 4.5.0  Allow function to allow $post_type to be a string
  *
- * @param object $post_type_object Post type object.
+ * @param  object|string $post_type Post type object or key of post type.
  * @return bool Whether the post type should be considered viewable.
  */
-function is_post_type_viewable( $post_type_object ) {
-	return $post_type_object->publicly_queryable || ( $post_type_object->_builtin && $post_type_object->public );
+function is_post_type_viewable( $post_type ) {
+	if ( is_scalar( $post_type ) ) {
+		if ( post_type_exists( $post_type ) ) {
+			$post_type = get_post_type_object( $post_type );
+		} else {
+			return false;
+		}
+	}
+	return $post_type->publicly_queryable || ( $post_type->_builtin && $post_type->public );
 }
 
 /**
