comment_email WordPress Filter Hook

The comment_email hook is used to modify the email address that a comment is sent to. This hook is useful for situations where you want to have comments sent to a different email address than the one specified in the WordPress settings. For example, you may want to have all comments on a particular post sent to your personal email address, rather than the address associated with your WordPress site. This hook can be used in conjunction with the comment_post hook to achieve this goal.

apply_filters( 'comment_email', string $comment_author_email, WP_Comment $comment ) #

Filters the comment author’s email for display.


Description

Care should be taken to protect the email address and assure that email harvesters do not capture your commenter’s email address.


Top ↑

Parameters

$comment_author_email

(string)The comment author's email address.

$comment

(WP_Comment)The comment object.


Top ↑

Source

File: wp-includes/comment-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.1.0The $comment parameter was added.
1.2.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
Show More