Make WordPress Core


Ignore:
Timestamp:
07/24/2009 07:23:11 AM (17 years ago)
Author:
azaozz
Message:

"Trash" status for comments updates, props caesarsgrunt, see #4529

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment.php

    r11734 r11741  
    744744        do_action('delete_comment', $comment_id);
    745745       
    746         wp_unschedule_comment_destruction($comment_id);
     746        wp_unschedule_comment_delete($comment_id);
    747747
    748748        $comment = get_comment($comment_id);
    … …  
    10381038function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) {
    10391039        global $wpdb;
    1040         wp_unschedule_comment_destruction($comment_id);
     1040        wp_unschedule_comment_delete($comment_id);
    10411041       
    10421042        $status = '0';
    … …  
    10591059                                return wp_delete_comment($comment_id);
    10601060                        $status = 'deleted';
    1061                         wp_schedule_comment_destruction($comment_id);
     1061                        wp_schedule_comment_delete($comment_id);
    10621062                        break;
    10631063                default:
    … …  
    10921092 * @return void
    10931093 */
    1094 function wp_schedule_comment_destruction($comment_id) {
    1095         $to_destroy = get_option('to_destroy');
    1096         if (!is_array($to_destroy))
    1097                 $to_destroy = array();
     1094function wp_schedule_comment_delete($comment_id) {
     1095        $to_delete = get_option('wp_scheduled_delete');
     1096        if ( !is_array($to_delete) )
     1097                $to_delete = array();
    10981098       
    1099         $to_destroy['comments'][$comment_id] = time();
     1099        $to_delete['comments'][$comment_id] = time();
    11001100       
    1101         update_option('to_destroy', $to_destroy);
     1101        update_option('wp_scheduled_delete', $to_delete);
    11021102}
    11031103
    … …  
    11101110 * @return void
    11111111 */
    1112 function wp_unschedule_comment_destruction($comment_id) {
    1113         $to_destroy = get_option('to_destroy');
    1114         if (!is_array($to_destroy))
     1112function wp_unschedule_comment_delete($comment_id) {
     1113        $to_delete = get_option('wp_scheduled_delete');
     1114        if ( !is_array($to_delete) )
    11151115                return;
    11161116       
    1117         unset($to_destroy['comments'][$comment_id]);
     1117        unset($to_delete['comments'][$comment_id]);
    11181118       
    1119         update_option('to_destroy', $to_destroy);
     1119        update_option('wp_scheduled_delete', $to_delete);
    11201120}
    11211121
Note: See TracChangeset for help on using the changeset viewer.