Don't save if both title and content are empty. fixes #2390

git-svn-id: https://develop.svn.wordpress.org/trunk@4117 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-08-25 00:27:15 +00:00
parent 03bd697b27
commit de56075801
1 changed files with 3 additions and 0 deletions

View File

@ -507,6 +507,9 @@ function wp_insert_post($postarr = array()) {
$ping_status = apply_filters('ping_status_pre', $ping_status);
}
if ( ('' == $post_content) && ('' == $post_title) )
return 0;
// Make sure we set a valid category
if (0 == count($post_category) || !is_array($post_category)) {
$post_category = array(get_option('default_category'));