WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp update comment

Description

Updates an existing comment in the database.

Filters the comment and makes sure certain fields are valid before updating.

Usage

<?php wp_update_comment$comment ?>

Parameters

$comment
(array) (required) Contains information on the comment. See get_comment() for a list of valid attributes.
Default: None

Return Values

(integer) 
Comment was updated if value is 1, or was not updated if value is 0.

Examples

Unapproving a comment

<?php
$comment = array();
$comment['comment_ID'] = 123;
$comment['comment_approved'] = 0;
wp_update_comment( $comment );
?>

Notes

Change Log

Since: 2.0.0

Source File

wp_update_comment() is located in wp-includes/comment.php.

Related

See also index of Function Reference and index of Template Tags.