comment_author_email

函式
comment_author_email ( $comment_ID = 0 )
引數
  • (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.
    Required:
定義位置
相關方法
get_comment_author_emailcomment_author_email_linkcomment_author_ipcomment_author_urlget_comment_author_email_link
引入
0.71
棄用
-

comment_author_email: 此函式返回評論的作者的電子郵件地址。

顯示當前全域性$comment的作者的電子郵件。

應該注意保護電子郵件地址,並保證電子郵件採集器不會捕獲你的評論者的電子郵件地址。大多數人認為他們的電子郵件地址不會以原始形式出現在網站上。這樣做將使任何人,包括那些人們不希望得到的電子郵件地址,並將其用於他們自己的好的和壞的手段。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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 );
}
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 ); }
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 );
}

常見問題

FAQs
檢視更多 >