wp_update_comment [ WordPress Function ]
wp_update_comment ( $commentarr )
| Parameters: |
|
| Uses: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: wp_update_comment_count, wp_update_core, wp_unspam_comment, wp_delete_comment, wp_spam_comment
Updates an existing comment in the database.
Filters the comment and makes sure certain fields are valid before updating.
Source
<?php
function wp_update_comment($commentarr) {
global $wpdb;
// First, get all of the original fields
$comment = get_comment($commentarr['comment_ID'], ARRAY_A);
// Escape data pulled from DB.
$comment = esc_sql($comment);
$old_status = $comment['comment_approved'];
// Merge old and new fields with new fields overwriting old ones.
$commentarr = array_merge($comment, $commentarr);
$commentarr = wp_filter_comment( $commentarr );
// Now extract the merged array.
extract(stripslashes_deep($commentarr), EXTR_SKIP);
$comment_content = apply_filters('comment_save_pre', $comment_content);
$comment_date_gmt = get_gmt_from_date($comment_date);
if ( !isset($comment_approved) )
$comment_approved = 1;
else if ( 'hold' == $comment_approved )
$comment_approved = 0;
else if ( 'approve' == $comment_approved )
$comment_approved = 1;
$data = compact('comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt');
$rval = $wpdb->update( $wpdb->comments, $data, compact( 'comment_ID' ) );
clean_comment_cache($comment_ID);
wp_update_comment_count($comment_post_ID);
do_action('edit_comment', $comment_ID);
$comment = get_comment($comment_ID);
wp_transition_comment_status($comment->comment_approved, $old_status, $comment);
return $rval;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/wp update comment « WordPress Codex
Description. Updates an existing comment in the database. Filters the comment and makes sure certain fields are valid before updating.
codex.wordpress.org - wp_update_comment | A HitchHackers guide through WordPress
Feb 12, 2011 ... Source code. function wp_update_comment($commentarr) { global $wpdb; // First, get all of the original fields $comment ...
hitchhackerguide.com - wp_update_comment() WordPress function reference, arguments ...
wp_update_comment(). Updates an existing comment in the database. Filters the comment and makes sure certain fields are valid before updating.
queryposts.com - wp_update_comment (WordPress Function) - WPSeek.com
WordPress lookup for wp_update_comment, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com