Changeset 34130
- Timestamp:
- 09/14/2015 09:46:40 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/comment.php
r34129 r34130 259 259 switch ( $action ) { 260 260 case 'deletecomment' : 261 wp_delete_comment( $comment _id);261 wp_delete_comment( $comment ); 262 262 $redir = add_query_arg( array('deleted' => '1'), $redir ); 263 263 break; 264 264 case 'trashcomment' : 265 wp_trash_comment( $comment_id);265 wp_trash_comment( $comment ); 266 266 $redir = add_query_arg( array('trashed' => '1', 'ids' => $comment_id), $redir ); 267 267 break; 268 268 case 'untrashcomment' : 269 wp_untrash_comment( $comment_id);269 wp_untrash_comment( $comment ); 270 270 $redir = add_query_arg( array('untrashed' => '1'), $redir ); 271 271 break; 272 272 case 'spamcomment' : 273 wp_spam_comment( $comment_id);273 wp_spam_comment( $comment ); 274 274 $redir = add_query_arg( array('spammed' => '1', 'ids' => $comment_id), $redir ); 275 275 break; 276 276 case 'unspamcomment' : 277 wp_unspam_comment( $comment_id);277 wp_unspam_comment( $comment ); 278 278 $redir = add_query_arg( array('unspammed' => '1'), $redir ); 279 279 break; -
trunk/src/wp-admin/includes/ajax-actions.php
r34129 r34130 527 527 if ( 'trash' == $status ) 528 528 wp_die( time() ); 529 $r = wp_trash_comment( $comment ->comment_ID);529 $r = wp_trash_comment( $comment ); 530 530 } elseif ( isset($_POST['untrash']) && 1 == $_POST['untrash'] ) { 531 531 if ( 'trash' != $status ) 532 532 wp_die( time() ); 533 $r = wp_untrash_comment( $comment ->comment_ID);533 $r = wp_untrash_comment( $comment ); 534 534 if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'trash' ) // undo trash, not in trash 535 535 $delta = 1; … … 537 537 if ( 'spam' == $status ) 538 538 wp_die( time() ); 539 $r = wp_spam_comment( $comment ->comment_ID);539 $r = wp_spam_comment( $comment ); 540 540 } elseif ( isset($_POST['unspam']) && 1 == $_POST['unspam'] ) { 541 541 if ( 'spam' != $status ) 542 542 wp_die( time() ); 543 $r = wp_unspam_comment( $comment ->comment_ID);543 $r = wp_unspam_comment( $comment ); 544 544 if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'spam' ) // undo spam, not in spam 545 545 $delta = 1; 546 546 } elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) { 547 $r = wp_delete_comment( $comment ->comment_ID);547 $r = wp_delete_comment( $comment ); 548 548 } else { 549 549 wp_die( -1 ); -
trunk/src/wp-includes/comment-functions.php
r34129 r34130 1165 1165 * @since 2.9.0 1166 1166 * 1167 * @param int $comment_id Comment ID.1167 * @param int|WP_Comment $comment_id Comment ID or WP_Comment object. 1168 1168 * @return bool True on success, false on failure. 1169 1169 */ 1170 function wp_unspam_comment($comment_id) { 1171 if ( ! (int)$comment_id ) 1172 return false; 1173 1170 function wp_unspam_comment( $comment_id ) { 1174 1171 $comment = get_comment( $comment_id ); 1175 1172 if ( ! $comment ) { … … 1184 1181 * @param int $comment_id The comment ID. 1185 1182 */ 1186 do_action( 'unspam_comment', $comment _id);1187 1188 $status = (string) get_comment_meta( $comment_id, '_wp_trash_meta_status', true);1183 do_action( 'unspam_comment', $comment->comment_ID ); 1184 1185 $status = (string) get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ); 1189 1186 if ( empty($status) ) 1190 1187 $status = '0'; 1191 1188 1192 1189 if ( wp_set_comment_status( $comment, $status ) ) { 1193 delete_comment_meta( $comment _id, '_wp_trash_meta_status' );1194 delete_comment_meta( $comment _id, '_wp_trash_meta_time' );1190 delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_status' ); 1191 delete_comment_meta( $comment->comment_ID, '_wp_trash_meta_time' ); 1195 1192 /** 1196 1193 * Fires immediately after a comment is unmarked as Spam. … … 1200 1197 * @param int $comment_id The comment ID. 1201 1198 */ 1202 do_action( 'unspammed_comment', $comment _id);1199 do_action( 'unspammed_comment', $comment->comment_ID ); 1203 1200 return true; 1204 1201 }
Note: See TracChangeset
for help on using the changeset viewer.