Curses on PHP 5.0.5. see #14160 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@15358 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c6f385ea6a
commit
ec40f6b186
|
@ -376,7 +376,8 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
|
||||||
$old_posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date" );
|
$old_posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date" );
|
||||||
foreach ( (array) $old_posts as $delete )
|
foreach ( (array) $old_posts as $delete )
|
||||||
wp_delete_post( $delete, true ); // Force delete
|
wp_delete_post( $delete, true ); // Force delete
|
||||||
$post = get_post( wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) ) );
|
$post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) );
|
||||||
|
$post = get_post( $post_id );
|
||||||
} else {
|
} else {
|
||||||
$post->ID = 0;
|
$post->ID = 0;
|
||||||
$post->post_author = '';
|
$post->post_author = '';
|
||||||
|
|
Loading…
Reference in New Issue