apply_filters( 'wp_update_comment_data', array|WP_Error $data, array $comment, array $commentarr )
- Since
- 4.7.0, 5.5.0
Filters the comment data immediately before it is updated in the database.
Description
Note: data being passed to the filter is already unslashed.
Compatibility
- WordPress
- since 5.5.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$dataarray|WP_Error- The new, processed comment data, or WP_Error.
$commentarray- The old, unslashed comment data.
$commentarrarray- The new, raw comment data.
Where this hook fires · 1
wp-includes/comment.php:2593wp_update_comment()
Source code
* and allow skipping further processing. * * @param array|WP_Error $data The new, processed comment data, or WP_Error. * @param array $comment The old, unslashed comment data. * @param array $commentarr The new, raw comment data. */ $data = apply_filters( 'wp_update_comment_data', $data, $comment, $commentarr ); // Do not carry on on failure. if ( is_wp_error( $data ) ) { if ( $wp_error ) { return $data; } else {Changelog
Introduced in 4.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
5.5.0
Returning a WP_Error value from the filter will short-circuit comment update and allow skipping further processing.from the docblock
4.7.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.