default is a valid page template. see #6098

git-svn-id: http://svn.automattic.com/wordpress/trunk@7925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-05-13 21:03:10 +00:00
parent 9b7daff0b4
commit 7b1e56dc06
1 changed files with 1 additions and 1 deletions

View File

@ -1297,7 +1297,7 @@ function wp_insert_post($postarr = array(), $wp_error = false) {
if ( !empty($page_template) && 'page' == $post_type ) {
$post->page_template = $page_template;
$page_templates = get_page_templates();
if ( ! in_array($page_template, $page_templates) ) {
if ( 'default' != $page_template && !in_array($page_template, $page_templates) ) {
if ( $wp_error )
return new WP_Error('invalid_page_template', __('The page template is invalid.'));
else