Changeset 11750 for trunk/wp-includes/post.php
- Timestamp:
- 07/30/2009 02:55:07 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)