diff --git a/wp-includes/post.php b/wp-includes/post.php index d8c8c55542..49ca9e243e 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3423,11 +3423,11 @@ function wp_insert_post( $postarr, $wp_error = false ) { if ( 'default' != $postarr['page_template'] && ! isset( $page_templates[ $postarr['page_template'] ] ) ) { if ( $wp_error ) { return new WP_Error('invalid_page_template', __('The page template is invalid.')); - } else { - return 0; } + update_post_meta( $post_ID, '_wp_page_template', 'default' ); + } else { + update_post_meta( $post_ID, '_wp_page_template', $postarr['page_template'] ); } - update_post_meta( $post_ID, '_wp_page_template', $postarr['page_template'] ); } if ( 'attachment' !== $postarr['post_type'] ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 3150403d0e..8368407749 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31019'; +$wp_version = '4.2-alpha-31020'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.