WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/14/2015 09:46:40 PM (6 years ago)
Author:
wonderboymusic
Message:

wp_unspam_comment() can accept a full object instead of comment_ID to reduce cache/db lookups..

See #33638.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r34129 r34130  
    527527        if ( 'trash' == $status )
    528528            wp_die( time() );
    529         $r = wp_trash_comment( $comment->comment_ID );
     529        $r = wp_trash_comment( $comment );
    530530    } elseif ( isset($_POST['untrash']) && 1 == $_POST['untrash'] ) {
    531531        if ( 'trash' != $status )
    532532            wp_die( time() );
    533         $r = wp_untrash_comment( $comment->comment_ID );
     533        $r = wp_untrash_comment( $comment );
    534534        if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'trash' ) // undo trash, not in trash
    535535            $delta = 1;
     
    537537        if ( 'spam' == $status )
    538538            wp_die( time() );
    539         $r = wp_spam_comment( $comment->comment_ID );
     539        $r = wp_spam_comment( $comment );
    540540    } elseif ( isset($_POST['unspam']) && 1 == $_POST['unspam'] ) {
    541541        if ( 'spam' != $status )
    542542            wp_die( time() );
    543         $r = wp_unspam_comment( $comment->comment_ID );
     543        $r = wp_unspam_comment( $comment );
    544544        if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'spam' ) // undo spam, not in spam
    545545            $delta = 1;
    546546    } elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) {
    547         $r = wp_delete_comment( $comment->comment_ID );
     547        $r = wp_delete_comment( $comment );
    548548    } else {
    549549        wp_die( -1 );
Note: See TracChangeset for help on using the changeset viewer.