# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /Applications/MAMP/htdocs/wordpress_develop/src/wp-includes
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: post.php
--- post.php Base (BASE)
+++ post.php Locally Modified (Based On LOCAL)
@@ -2931,6 +2931,10 @@
 
 	$postarr = wp_parse_args($postarr, $defaults);
 
+	if( ! post_type_exists( $postarr['post_type'] ) ) {
+		return new WP_Error( 'invalid_post_type', __( 'Post type does not exist.' ) );
+	}
+	
 	unset( $postarr[ 'filter' ] );
 
 	$postarr = sanitize_post($postarr, 'db');
