wp_update_comment_data WordPress Filter Hook

The wp_update_comment_data hook is called before a comment is updated in the database. It allows you to modify the comment data before it is saved.

apply_filters( 'wp_update_comment_data', array|WP_Error $data, array $comment, array $commentarr ) #

Filters the comment data immediately before it is updated in the database.


Description

Note: data being passed to the filter is already unslashed.


Top ↑

Parameters

$data

(array|WP_Error)The new, processed comment data, or WP_Error.

$comment

(array)The old, unslashed comment data.

$commentarr

(array)The new, raw comment data.


Top ↑

Source

File: wp-includes/comment.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.5.0Returning a WP_Error value from the filter will short-circuit comment update and allow skipping further processing.
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More