More comment functions can accept a full object instead of comment_ID to reduce cache/db lookups.

See ##33638.



git-svn-id: https://develop.svn.wordpress.org/trunk@34129 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2015-09-14 21:39:46 +00:00
parent ab7ca361dd
commit 166ee8674b
5 changed files with 83 additions and 70 deletions

View File

@@ -278,11 +278,11 @@ case 'unapprovecomment' :
$redir = add_query_arg( array('unspammed' => '1'), $redir );
break;
case 'approvecomment' :
wp_set_comment_status( $comment_id, 'approve' );
wp_set_comment_status( $comment, 'approve' );
$redir = add_query_arg( array( 'approved' => 1 ), $redir );
break;
case 'unapprovecomment' :
wp_set_comment_status( $comment_id, 'hold' );
wp_set_comment_status( $comment, 'hold' );
$redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
break;
}