Don't save if both title and content are empty. fixes #2390
git-svn-id: http://svn.automattic.com/wordpress/trunk@4117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e650a94fd0
commit
ae61439266
|
@ -507,6 +507,9 @@ function wp_insert_post($postarr = array()) {
|
||||||
$ping_status = apply_filters('ping_status_pre', $ping_status);
|
$ping_status = apply_filters('ping_status_pre', $ping_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ('' == $post_content) && ('' == $post_title) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
// Make sure we set a valid category
|
// Make sure we set a valid category
|
||||||
if (0 == count($post_category) || !is_array($post_category)) {
|
if (0 == count($post_category) || !is_array($post_category)) {
|
||||||
$post_category = array(get_option('default_category'));
|
$post_category = array(get_option('default_category'));
|
||||||
|
|
Loading…
Reference in New Issue