Changeset 34130 for trunk/src/wp-includes/comment-functions.php
- Timestamp:
- 09/14/2015 09:46:40 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.