wordpress技巧如何显示当前评论的作者email

706 ℃

wordpress建站中,如何利用自身函数显示当前评论的作者email,下面web建站小编给大家简单介绍一下comment_author_email函数的基本用法!

函数原型:

comment_author_email( int|WP_Comment $comment_id )

函数源码:

function comment_author_email( $comment_id = 0 ) {
  $comment      = get_comment( $comment_id );
  $author_email = get_comment_author_email( $comment );
  
  echo apply_filters( 'author_email', $author_email, $comment->comment_ID );
}

调用方法:

<a href="mailto:<?php comment_author_email(); ?>">
  <?php printf( __( 'Contact %s', 'textdomain' ), get_comment_author() ); ?>
</a>

wordpress做时间列表,比如2024年1月文章列表

WordPress评论相关功能介绍

wordpress利用mysql获取指定分类下的文章

WordPress如何重置admin密码

WordPress教程如何自动删除文章中图片宽高样式

标签: comment_author_email, wordpress技巧, wordpress评论

上面是“wordpress技巧如何显示当前评论的作者email”的全面内容,想了解更多关于 wordpress 内容,请继续关注web建站教程。

当前网址:https://m.ipkd.cn/webs_4603.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

Trae:新一代免费的AI编程工具
利用纯css3做一个风车动画效果
JavaScript开发小技巧之各种浏览器操作
wordpress如何在图片上显示喜欢的水印(Image Watermark水印插件)
简单介绍前端代码规范的七个原则(前端代码规范指南)
wordpress如何获取网站url地址