WordPress函数wp_get_current_commenter()用于获取当前评论者的姓名、电子邮件和URL,该函数没有参数。

wp_get_current_commenter(): array

函数返回值

当前评论者信息的数组:

  • comment_author:当前评论者的名称;

  • comment_author_email:当前评论者的电子邮件地址;

  • comment_author_url:当前评论者的url地址;

函数使用示例

$current_commenter = wp_get_current_commenter();

返回示例:

Array
(
    [comment_author] => 背字根
    [comment_author_email] => beizigen@qq.com
    [comment_author_url] => https://www.beizigen.com/
)

扩展阅读

wp_get_current_commenter()函数位于:wp-includes/comment.php

相关函数:

  • comment_form()
  • comments_template()

觉得上面的内容有用吗?快来点个赞吧!

点赞() 我要打赏

温馨提示 : 本站内容来自会员投稿以及互联网,所有源码及教程均为作者总结编辑,请大家在使用过程中提前做好备份,以免发生无法预知的错误,源码类教程请勿直接用于生产环境!

 可能感兴趣的文章