Make WordPress Core


Ignore:
Timestamp:
10/31/2008 06:05:25 PM (17 years ago)
Author:
markjaquith
Message:

Improvements to the Edit Comment screen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment-template.php

    r9424 r9436  
    8181 * @since 0.71
    8282 * @uses apply_filters() Calls 'comment_email' hook for the display of the comment author's email
     83 * @uses get_comment_author_email_link() For generating the link
    8384 * @global object $comment The current Comment row object
    8485 *
     
    8889 */
    8990function comment_author_email_link($linktext='', $before='', $after='') {
     91    if ( $link = get_comment_author_email_link( $linktext, $before, $after ) )
     92        echo $link;
     93}
     94
     95/**
     96 * Return the html email link to the author of the current comment.
     97 *
     98 * Care should be taken to protect the email address and assure that email
     99 * harvesters do not capture your commentors' email address. Most assume that
     100 * their email address will not appear in raw form on the blog. Doing so will
     101 * enable anyone, including those that people don't want to get the email
     102 * address and use it for their own means good and bad.
     103 *
     104 * @since 2.7
     105 * @uses apply_filters() Calls 'comment_email' hook for the display of the comment author's email
     106 * @global object $comment The current Comment row object
     107 *
     108 * @param string $linktext The text to display instead of the comment author's email address
     109 * @param string $before The text or HTML to display before the email link.
     110 * @param string $after The text or HTML to display after the email link.
     111 */
     112function get_comment_author_email_link($linktext='', $before='', $after='') {
    90113    global $comment;
    91114    $email = apply_filters('comment_email', $comment->comment_author_email);
    92115    if ((!empty($email)) && ($email != '@')) {
    93116    $display = ($linktext != '') ? $linktext : $email;
    94         echo $before;
    95         echo "<a href='mailto:$email'>$display</a>";
    96         echo $after;
     117        $return  = $before;
     118        $return .= "<a href='mailto:$email'>$display</a>";
     119        $return .= $after;
     120        return $return;
     121    } else {
     122        return '';
    97123    }
    98124}
Note: See TracChangeset for help on using the changeset viewer.