wp_get_current_commenter

过滤钩子
apply_filters( 'wp_get_current_commenter', compact( 'comment_author', 'comment_author_email', 'comment_author_url' )
参数
  • (array) $comment_author_data { An array of current commenter variables. @type string $comment_author The name of the current commenter, or an empty string. @type string $comment_author_email The email address of the current commenter, or an empty string. @type string $comment_author_url The URL address of the current commenter, or an empty string. }
    Required:
定义位置
相关勾子
wp_count_commentsset_current_userget_commentwp_insert_commentrest_comment_query
相关方法
wp_get_current_commenterwp_get_current_user_wp_get_current_userwp_set_current_userwp_count_commentsget_current_screen
引入
3.1.0
弃用
-

wp_get_current_commenter:此函数用于检索当前评论者的姓名、电子邮件和 URL。此信息在预填写评论表单时非常有用,因为它可以通过记住他们之前评论中的信息来节省用户时间。

过滤当前评论者的姓名、电子邮件和网址。

return apply_filters( 'wp_get_current_commenter', compact( 'comment_author', 'comment_author_email', 'comment_author_url' ) );

常见问题

FAQs
查看更多 >