Changeset 2662 for trunk/wp-includes/functions-post.php
- Timestamp:
- 06/26/2005 07:55:12 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions-post.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions-post.php
r2651 r2662 163 163 } 164 164 165 // Return insert_id if we got a good result, otherwise return zero. 166 return $result ? $post_ID : 0; 165 return $rval; 167 166 } 168 167 … … 587 586 588 587 return $result; 588 } 589 590 function wp_update_comment($commentarr) { 591 global $wpdb; 592 593 // First, get all of the original fields 594 $comment = get_comment($commentarr['comment_ID'], ARRAY_A); 595 596 // Escape data pulled from DB. 597 foreach ($comment as $key => $value) 598 $comment[$key] = $wpdb->escape($value); 599 600 // Merge old and new fields with new fields overwriting old ones. 601 $commentarr = array_merge($comment, $commentarr); 602 603 // Now extract the merged array. 604 extract($commentarr); 605 606 $comment_content = apply_filters('comment_save_pre', $comment_content); 607 608 $result = $wpdb->query( 609 "UPDATE $wpdb->comments SET 610 comment_content = '$comment_content', 611 comment_author = '$comment_author', 612 comment_author_email = '$comment_author_email', 613 comment_approved = '$comment_approved', 614 comment_author_url = '$comment_author_url', 615 comment_date = '$comment_date' 616 WHERE comment_ID = $comment_ID" ); 617 618 $rval = $wpdb->rows_affected; 619 620 do_action('edit_comment', $comment_ID); 621 622 return $rval; 589 623 } 590 624
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)