comment_author_email

The timeline below displays how wordpress function comment_author_email has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Displays the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commenter's email address. Most assume that
 * their email address will not appear in raw form on the site. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
 *
 * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to print the author's email.
 *                                   Default current comment.
 */
function comment_author_email($comment_id = 0)
{
    $comment = get_comment($comment_id);
    $comment_author_email = get_comment_author_email($comment);
    /**
     * Filters the comment author's email for display.
     *
     * @since 1.2.0
     * @since 4.1.0 The `$comment_id` parameter was added.
     *
     * @param string $comment_author_email The comment author's email address.
     * @param string $comment_id           The comment ID as a numeric string.
     */
    echo apply_filters('author_email', $comment_author_email, $comment->comment_ID);
}

WordPress Version: 6.2

/**
 * Displays the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commenter's email address. Most assume that
 * their email address will not appear in raw form on the site. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object.
 *
 * @param int|WP_Comment $comment_id Optional. WP_Comment or the ID of the comment for which to print the author's email.
 *                                   Default current comment.
 */
function comment_author_email($comment_id = 0)
{
    $comment = get_comment($comment_id);
    $author_email = get_comment_author_email($comment);
    /**
     * Filters the comment author's email for display.
     *
     * @since 1.2.0
     * @since 4.1.0 The `$comment_id` parameter was added.
     *
     * @param string $author_email The comment author's email address.
     * @param string $comment_id   The comment ID as a numeric string.
     */
    echo apply_filters('author_email', $author_email, $comment->comment_ID);
}

WordPress Version: 5.9

/**
 * Displays the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commenter's email address. Most assume that
 * their email address will not appear in raw form on the site. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
 *
 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
 *                                   Default current comment.
 */
function comment_author_email($comment_ID = 0)
{
    $comment = get_comment($comment_ID);
    $author_email = get_comment_author_email($comment);
    /**
     * Filters the comment author's email for display.
     *
     * @since 1.2.0
     * @since 4.1.0 The `$comment_ID` parameter was added.
     *
     * @param string $author_email The comment author's email address.
     * @param string $comment_ID   The comment ID as a numeric string.
     */
    echo apply_filters('author_email', $author_email, $comment->comment_ID);
}

WordPress Version: 5.4

/**
 * Displays the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commenter's email address. Most assume that
 * their email address will not appear in raw form on the site. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
 *
 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
 *                                   Default current comment.
 */
function comment_author_email($comment_ID = 0)
{
    $comment = get_comment($comment_ID);
    $author_email = get_comment_author_email($comment);
    /**
     * Filters the comment author's email for display.
     *
     * @since 1.2.0
     * @since 4.1.0 The `$comment_ID` parameter was added.
     *
     * @param string $author_email The comment author's email address.
     * @param int    $comment_ID   The comment ID.
     */
    echo apply_filters('author_email', $author_email, $comment->comment_ID);
}

WordPress Version: 5.2

/**
 * Display the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commenter's email address. Most assume that
 * their email address will not appear in raw form on the site. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
 *
 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
 *                                   Default current comment.
 */
function comment_author_email($comment_ID = 0)
{
    $comment = get_comment($comment_ID);
    $author_email = get_comment_author_email($comment);
    /**
     * Filters the comment author's email for display.
     *
     * @since 1.2.0
     * @since 4.1.0 The `$comment_ID` parameter was added.
     *
     * @param string $author_email The comment author's email address.
     * @param int    $comment_ID   The comment ID.
     */
    echo apply_filters('author_email', $author_email, $comment->comment_ID);
}

WordPress Version: 5.1

/**
 * Display the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commentors' email address. Most assume that
 * their email address will not appear in raw form on the site. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
 *
 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
 *                                   Default current comment.
 */
function comment_author_email($comment_ID = 0)
{
    $comment = get_comment($comment_ID);
    $author_email = get_comment_author_email($comment);
    /**
     * Filters the comment author's email for display.
     *
     * @since 1.2.0
     * @since 4.1.0 The `$comment_ID` parameter was added.
     *
     * @param string $author_email The comment author's email address.
     * @param int    $comment_ID   The comment ID.
     */
    echo apply_filters('author_email', $author_email, $comment->comment_ID);
}

WordPress Version: 4.6

/**
 * Display the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commentors' email address. Most assume that
 * their email address will not appear in raw form on the site. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
 *
 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
 *									 Default current comment.
 */
function comment_author_email($comment_ID = 0)
{
    $comment = get_comment($comment_ID);
    $author_email = get_comment_author_email($comment);
    /**
     * Filters the comment author's email for display.
     *
     * @since 1.2.0
     * @since 4.1.0 The `$comment_ID` parameter was added.
     *
     * @param string $author_email The comment author's email address.
     * @param int    $comment_ID   The comment ID.
     */
    echo apply_filters('author_email', $author_email, $comment->comment_ID);
}

WordPress Version: 4.5

/**
 * Display the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commentors' email address. Most assume that
 * their email address will not appear in raw form on the site. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
 *
 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
 *									 Default current comment.
 */
function comment_author_email($comment_ID = 0)
{
    $comment = get_comment($comment_ID);
    $author_email = get_comment_author_email($comment);
    /**
     * Filter the comment author's email for display.
     *
     * @since 1.2.0
     * @since 4.1.0 The `$comment_ID` parameter was added.
     *
     * @param string $author_email The comment author's email address.
     * @param int    $comment_ID   The comment ID.
     */
    echo apply_filters('author_email', $author_email, $comment->comment_ID);
}

WordPress Version: 4.4

/**
 * Display the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commentors' email address. Most assume that
 * their email address will not appear in raw form on the blog. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
 *
 * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email.
 *									 Default current comment.
 */
function comment_author_email($comment_ID = 0)
{
    $comment = get_comment($comment_ID);
    $author_email = get_comment_author_email($comment);
    /**
     * Filter the comment author's email for display.
     *
     * @since 1.2.0
     * @since 4.1.0 The `$comment_ID` parameter was added.
     *
     * @param string $author_email The comment author's email address.
     * @param int    $comment_ID   The comment ID.
     */
    echo apply_filters('author_email', $author_email, $comment->comment_ID);
}

WordPress Version: 4.1

/**
 * Display the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commentors' email address. Most assume that
 * their email address will not appear in raw form on the blog. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 *
 * @param int $comment_ID Optional. The ID of the comment for which to print the author's email. Default current comment.
 */
function comment_author_email($comment_ID = 0)
{
    $author_email = get_comment_author_email($comment_ID);
    /**
     * Filter the comment author's email for display.
     *
     * @since 1.2.0
     * @since 4.1.0 The `$comment_ID` parameter was added.
     *
     * @param string $author_email The comment author's email address.
     * @param int    $comment_ID   The comment ID.
     */
    echo apply_filters('author_email', $author_email, $comment_ID);
}

WordPress Version: 3.8

/**
 * Display the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commentors' email address. Most assume that
 * their email address will not appear in raw form on the blog. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 *
 * @param int $comment_ID Optional. The ID of the comment for which to print the author's email. Default current comment.
 */
function comment_author_email($comment_ID = 0)
{
    $author_email = get_comment_author_email($comment_ID);
    /**
     * Filter the comment author's email for display.
     *
     * @since 1.2.0
     *
     * @param string $author_email The comment author's email address.
     */
    echo apply_filters('author_email', $author_email);
}

WordPress Version: 3.7

/**
 * Display the email of the author of the current global $comment.
 *
 * Care should be taken to protect the email address and assure that email
 * harvesters do not capture your commentors' email address. Most assume that
 * their email address will not appear in raw form on the blog. Doing so will
 * enable anyone, including those that people don't want to get the email
 * address and use it for their own means good and bad.
 *
 * @since 0.71
 *
 * @param int $comment_ID Optional. The ID of the comment for which to print the author's email. Default current comment.
 */
function comment_author_email($comment_ID = 0)
{
    $author_email = get_comment_author_email($comment_ID);
    /**
     * Filter the comment author's email for display.
     *
     * @since 1.2.1
     *
     * @param string $author_email The comment author's email address.
     */
    echo apply_filters('author_email', $author_email);
}