preprocess_comment

preprocess_comment

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.5.2

do_action('preprocess_comment') is found 1 times:

  • /wp-includes/comment.php line 2243
    	 * @since 5.6.0 Comment data includes the `comment_agent` and `comment_author_IP` values.
    	 *
    	 * @param array $commentdata Comment data.
    	 */
    	$commentdata = apply_filters( 'preprocess_comment', $commentdata );
    
    	$commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];
    
    	// Normalize `user_ID` to `user_id` again, after the filter.
    	if ( isset( $commentdata['user_ID'] ) && $prefiltered_user_id !== (int) $commentdata['user_ID'] ) {
    		$commentdata['user_ID'] = (int) $commentdata['user_ID'];
    

See this hook used in plugins: