Changeset 11945 for trunk/wp-includes/comment.php
- Timestamp:
- 09/17/2009 08:51:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r11943 r11945 820 820 do_action('delete_comment', $comment_id); 821 821 822 $trash_meta = get_option('wp_trash_meta'); 823 if (is_array($trash_meta) && isset($trash_meta['comments'][$comment_id])) { 824 unset($trash_meta['comments'][$comment_id]); 825 update_option('wp_trash_meta', $trash_meta); 826 } 822 delete_comment_meta($comment_id,'_wp_trash_meta_status'); 823 delete_comment_meta($comment_id,'_wp_trash_meta_time'); 827 824 828 825 if ( ! $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id) ) ) … … 866 863 do_action('trash_comment', $comment_id); 867 864 868 $trash_meta = get_option('wp_trash_meta', array()); 869 $trash_meta['comments'][$comment_id]['status'] = $comment->comment_approved; 870 $trash_meta['comments'][$comment_id]['time'] = time(); 871 update_option('wp_trash_meta', $trash_meta); 872 865 add_comment_meta($comment_id,'_wp_trash_meta_status', $comment->comment_approved); 866 add_comment_meta($comment_id,'_wp_trash_meta_time', time() ); 867 873 868 wp_set_comment_status($comment_id, 'trash'); 874 869 … … 892 887 893 888 $comment = array('comment_ID'=>$comment_id, 'comment_approved'=>'0'); 894 895 $trash_meta = get_option('wp_trash_meta'); 896 if (is_array($trash_meta) && isset($trash_meta['comments'][$comment_id])) { 897 $comment['comment_approved'] = $trash_meta['comments'][$comment_id]['status']; 898 unset($trash_meta['comments'][$comment_id]); 899 update_option('wp_trash_meta', $trash_meta); 900 } 889 890 //Either set comment_approved to the value in comment_meta or worse case to false which will mean moderation 891 $comment['comment_approved'] = get_comment_meta($comment_id, '_wp_trash_meta_status', true); 901 892 902 893 wp_update_comment($comment);
Note: See TracChangeset
for help on using the changeset viewer.