Changeset 10681 for trunk/wp-includes/comment.php
- Timestamp:
- 03/02/2009 09:48:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment.php
r10579 r10681 1015 1015 * @param int $comment_id Comment ID. 1016 1016 * @param string $comment_status New comment status, either 'hold', 'approve', 'spam', or 'delete'. 1017 * @param bool $wp_error Whether to return a WP_Error object if there is a failure. Default is false. 1017 1018 * @return bool False on failure or deletion and true on success. 1018 1019 */ 1019 function wp_set_comment_status($comment_id, $comment_status ) {1020 function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) { 1020 1021 global $wpdb; 1021 1022 … … 1041 1042 } 1042 1043 1043 if ( !$wpdb->query($query) ) 1044 return false; 1044 if ( !$wpdb->query($query) ) { 1045 if ( $wp_error ) 1046 return new WP_Error('db_update_error', __('Could not update comment status'), $wpdb->last_error); 1047 else 1048 return false; 1049 } 1045 1050 1046 1051 clean_comment_cache($comment_id);
Note: See TracChangeset
for help on using the changeset viewer.