WordPress.org

Make WordPress Core

Changeset 12430


Ignore:
Timestamp:
12/17/09 17:54:23 (4 years ago)
Author:
ryan
Message:

Delete all comment meta when deleting a comment. Props nacin. fixes #11463

File:
1 edited

Legend:

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

    r12428 r12430  
    807807 * @uses $wpdb 
    808808 * @uses do_action() Calls 'delete_comment' hook on comment ID 
     809 * @uses do_action() Calls 'deleted_comment' hook on comment ID after deletion, on success 
    809810 * @uses do_action() Calls 'wp_set_comment_status' hook on comment ID with 'delete' set for the second parameter 
    810811 * @uses wp_transition_comment_status() Passes new and old comment status along with $comment object 
     
    822823 
    823824    do_action('delete_comment', $comment_id); 
    824  
    825     if ( ! $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id) ) ) 
    826         return false; 
    827825 
    828826    // Move children up a level. 
     
    841839        do_action( 'deleted_commentmeta', $meta_ids ); 
    842840    } 
     841 
     842    if ( ! $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id) ) ) 
     843        return false; 
     844    do_action('deleted_comment', $comment_id); 
    843845 
    844846    $post_id = $comment->comment_post_ID; 
Note: See TracChangeset for help on using the changeset viewer.