Changeset 11750
- Timestamp:
- 07/30/2009 02:55:07 PM (15 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r11749 r11750 3353 3353 $delete_timestamp = time() - (60*60*24*EMPTY_TRASH_DAYS); 3354 3354 3355 foreach ( $trash_meta['comments'] as $id => $meta ) {3355 foreach ( (array) $trash_meta['comments'] as $id => $meta ) { 3356 3356 if ( $meta['time'] < $delete_timestamp ) { 3357 3357 wp_delete_comment($id); … … 3359 3359 } 3360 3360 } 3361 foreach ( $trash_meta['posts'] as $id => $meta ) {3361 foreach ( (array) $trash_meta['posts'] as $id => $meta ) { 3362 3362 if ( $meta['time'] < $delete_timestamp ) { 3363 3363 wp_delete_post($id); 3364 unset($t o_delete['posts'][$id]);3364 unset($trash_meta['posts'][$id]); 3365 3365 } 3366 3366 } 3367 3367 3368 update_option('wp_ scheduled_delete', $to_delete);3369 } 3368 update_option('wp_trash_meta', $trash_meta); 3369 } -
trunk/wp-includes/post.php
r11749 r11750 1250 1250 1251 1251 /** 1252 * Re moves a post or page from the Trash1252 * Restores a post or page from the Trash 1253 1253 * 1254 1254 * @since 2.9.0 … … 1260 1260 */ 1261 1261 function wp_untrash_post($postid = 0) { 1262 if ( !$post = wp_get_single_post($postid, ARRAY_A))1262 if ( !$post = wp_get_single_post($postid, ARRAY_A) ) 1263 1263 return $post; 1264 1264 1265 1265 do_action('untrash_post', $postid); 1266 1266 1267 1267 $post['post_status'] = 'draft'; 1268 1268 1269 1269 $trash_meta = get_option('wp_trash_meta'); 1270 if ( is_array($trash_meta) && isset($trash_meta['posts'][$postid])) {1270 if ( is_array($trash_meta) && isset($trash_meta['posts'][$postid]) ) { 1271 1271 $post['post_status'] = $trash_meta['posts'][$postid]['status']; 1272 1272 unset($trash_meta['posts'][$postid]); 1273 1273 update_option('wp_trash_meta', $trash_meta); 1274 1274 } 1275 1275 1276 1276 wp_insert_post($post); 1277 1277 1278 1278 do_action('untrashed_post', $postid); 1279 1279 … … 2663 2663 if ( 'attachment' != $post->post_type ) 2664 2664 return false; 2665 2665 2666 2666 if ( 'trash' != $post->post_status ) 2667 2667 return wp_trash_post($postid);
Note: See TracChangeset
for help on using the changeset viewer.