mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
default is a valid page template. see #6098
git-svn-id: https://develop.svn.wordpress.org/trunk@7925 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user