加入收藏 | 设为首页 | 会员中心 | 我要投稿 财气旺网 - 财气网 (https://www.caiqiwang.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 教程 > 正文

AUTHOR_EMAIL FILTER自定义评论作者的EMAIL

发布时间:2022-06-25 11:35:11 所属栏目:教程 来源:互联网
导读:wordpress4.1新增了一个钩子:author_email,可以利用这个filter显示自定义评论作者的email,形式如下: apply_filters ( author_email, string $author_email, int $comment_ID ) 在wp-includes/comment-template.php的comment_author_email函数中用到了author_
  wordpress4.1新增了一个钩子:author_email,可以利用这个filter显示自定义评论作者的email,形式如下:
 
  apply_filters ( ‘author_email’, string $author_email, int $comment_ID )
 
  在wp-includes/comment-template.php的comment_author_email函数中用到了author_email的filter.
 
  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.
       * //phpfensi.com
       * @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 );
  }。

(编辑:财气旺网 - 财气网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!