Make WordPress Core

Changeset 33654


Ignore:
Timestamp:
08/20/2015 02:44:39 AM (11 years ago)
Author:
wonderboymusic
Message:

Comments shouldn't have more than one _wp_trash_meta_status entry. When deleting _wp_trash_meta_status, also delete _wp_trash_meta_time.

See #11200.

File:
1 edited

Legend:

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

    r33223 r33654  
    18581858
    18591859        if ( wp_set_comment_status($comment_id, 'trash') ) {
    1860                 add_comment_meta($comment_id, '_wp_trash_meta_status', $comment->comment_approved);
    1861                 add_comment_meta($comment_id, '_wp_trash_meta_time', time() );
     1860                delete_comment_meta( $comment_id, '_wp_trash_meta_status' );
     1861                delete_comment_meta( $comment_id, '_wp_trash_meta_time' );
     1862                add_comment_meta( $comment_id, '_wp_trash_meta_status', $comment->comment_approved );
     1863                add_comment_meta( $comment_id, '_wp_trash_meta_time', time() );
    18621864
    18631865                /**
     
    19391941
    19401942        if ( wp_set_comment_status($comment_id, 'spam') ) {
    1941                 add_comment_meta($comment_id, '_wp_trash_meta_status', $comment->comment_approved);
     1943                delete_comment_meta( $comment_id, '_wp_trash_meta_status' );
     1944                delete_comment_meta( $comment_id, '_wp_trash_meta_time' );
     1945                add_comment_meta( $comment_id, '_wp_trash_meta_status', $comment->comment_approved );
     1946                add_comment_meta( $comment_id, '_wp_trash_meta_time', time() );
    19421947                /**
    19431948                 * Fires immediately after a comment is marked as Spam.
     
    19801985
    19811986        if ( wp_set_comment_status($comment_id, $status) ) {
    1982                 delete_comment_meta($comment_id, '_wp_trash_meta_status');
     1987                delete_comment_meta( $comment_id, '_wp_trash_meta_status' );
     1988                delete_comment_meta( $comment_id, '_wp_trash_meta_time' );
    19831989                /**
    19841990                 * Fires immediately after a comment is unmarked as Spam.
Note: See TracChangeset for help on using the changeset viewer.