wp_notify_postauthor()过滤用于重定向的URL

目录

描述

译文

该函数可由插件代替。若插件无法重新定义函数,则使用该函数。

该函数过滤用于重定向的URL。

原文

This function is responsible for sending comment notification emails to the post author whenever a reader leaves a comment. It is pluggable and can be customized using plugins.

This function is pluggable using the following filters:

  • comment_notification_text
  • comment_notification_subject
  • comment_notification_headers

If the plugins do not redefine the functions using filters, then the default functionality will be used.

To modify the content of the email that is sent when a reader leaves a comment, you may provide filters for each of the above functions in your plugin.

This function also sanitizes a URL for use in a redirect.

wp_notify_postauthor() 描述

用法

<?php wp_notify_postauthor$comment_id ?>

wp_notify_postauthor() 用法

参数

$comment_id

(integer) (必填) Comment ID

默认值: None

$deprecated

(string) (可选) Deprecated in Version 3.8 and should no longer be used. The comment type either 'comment' (default), 'trackback', or 'pingback'

默认值: ''

wp_notify_postauthor() 参数

返回值

(boolean) 

False if user email does not exist. True on completion.

wp_notify_postauthor() 返回值

注意

  • This function can be replaced via plugins. If plugins do not redefine these functions, then this will be used instead.
  • 使用到: apply_filters() 调用 'allowed_redirect_hosts' on an array containing WordPress host string and $location host string.

wp_notify_postauthor() 注意

历史

  • 3.8.0: The comment $comment_type parameter was deprecated. See ticket #17862.
  • 添加于 版本: 1.0.0

wp_notify_postauthor() 历史

源文件

wp_notify_postauthor() 函数的代码位于 wp-includes/pluggable.php.

wp_notify_postauthor() 源文件