diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index e74e256..54377c1 100644
a
|
b
|
function wp_insert_post( $postarr, $wp_error = false ) { |
3078 | 3078 | |
3079 | 3079 | $postarr = wp_parse_args($postarr, $defaults); |
3080 | 3080 | |
| 3081 | if( ! post_type_exists( $postarr['post_type'] ) ) { |
| 3082 | return new WP_Error( 'invalid_post_type', sprintf( __( 'Post type "%s" does not exist.' ), $postarr['post_type'] ) ); |
| 3083 | } |
| 3084 | |
3081 | 3085 | unset( $postarr[ 'filter' ] ); |
3082 | 3086 | |
3083 | 3087 | $postarr = sanitize_post($postarr, 'db'); |