Use temporary title when creating empty posts. Props mdawaffe. fixes #3097

git-svn-id: https://develop.svn.wordpress.org/trunk@4570 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-12-01 04:38:07 +00:00
parent b002e7ce66
commit 77e4790a50

View File

@ -155,7 +155,10 @@ case 'add-meta' :
if ( !current_user_can( 'edit_post', $id ) )
die('-1');
if ( $id < 0 ) {
if ( $pid = wp_insert_post() )
$now = current_time('timestamp');
if ( $pid = wp_insert_post( array(
'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now))
) ) )
$mid = add_meta( $pid );
else
die('0');