Changeset 10730 for trunk/wp-includes/comment.php
- Timestamp:
- 03/06/2009 04:27:51 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/comment.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r10681 r10730 1021 1021 global $wpdb; 1022 1022 1023 $status = '0'; 1023 1024 switch ( $comment_status ) { 1024 1025 case 'hold': 1025 $ query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='0' WHERE comment_ID = %d LIMIT 1", $comment_id);1026 $status = '0'; 1026 1027 break; 1027 1028 case 'approve': 1028 $ query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID = %d LIMIT 1", $comment_id);1029 $status = '1'; 1029 1030 if ( get_option('comments_notify') ) { 1030 1031 $comment = get_comment($comment_id); … … 1033 1034 break; 1034 1035 case 'spam': 1035 $ query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID = %d LIMIT 1", $comment_id);1036 $status = 'spam'; 1036 1037 break; 1037 1038 case 'delete': … … 1042 1043 } 1043 1044 1044 if ( !$wpdb-> query($query) ) {1045 if ( !$wpdb->update( $wpdb->comments, array('comment_approved' => $status), array('comment_ID' => $comment_id) ) ) { 1045 1046 if ( $wp_error ) 1046 1047 return new WP_Error('db_update_error', __('Could not update comment status'), $wpdb->last_error); … … 1351 1352 $pinged = get_pung($post_id); 1352 1353 if ( empty($to_ping) ) { 1353 $wpdb-> query( $wpdb->prepare("UPDATE $wpdb->posts SET to_ping = '' WHERE ID = %d", $post_id) );1354 $wpdb->update($wpdb->posts, array('to_ping' => ''), array('ID' => $post_id) ); 1354 1355 return; 1355 1356 }
Note: See TracChangeset
for help on using the changeset viewer.