Template Tags/comment author email link
Материал из WordPress Wiki
Содержание |
Description
Displays the comment author's email address, as a mailto link. An email address must be provided if "User must fill out name and email" is enabled under Discussion Options. This tag must be within The Loop, or a comment loop.
Note: Displaying email addresses is not recommended, as it provides spam collection tools the opportunity to cull them from your site.
Usage
%%% <?php comment_author_email_link('linktext', 'before', 'after'); ?> %%%
Examples
Default Usage
email: <?php comment_author_email_link(); ?><br />
Link Text and Styling
Displays comment author's email link as text string Email Comment Author and adds arrows before and after the link to style it.
<?php comment_author_email_link('Email Comment Author', ' > ', ' < '); ?>
Parameters
- linktext
- (string) Link text for the email link. Default is the comment author's email address.
- before
- (string) Text to display before the link. There is no default.
- after
- (string) Text to display after the link. There is no default.