comment_notification_notify_author хук-фильтрWP 3.8.0

Filters whether to notify comment authors of their comments on their own posts.

By default, comment authors aren't notified of their comments on their own posts. This filter allows you to override that.

Использование

add_filter( 'comment_notification_notify_author', 'wp_kama_comment_notification_notify_author_filter', 10, 2 );

/**
 * Function for `comment_notification_notify_author` filter-hook.
 * 
 * @param bool   $notify     Whether to notify the post author of their own comment.
 * @param string $comment_id The comment ID as a numeric string.
 *
 * @return bool
 */
function wp_kama_comment_notification_notify_author_filter( $notify, $comment_id ){

	// filter...
	return $notify;
}
$notify(true|false)
Whether to notify the post author of their own comment.
По умолчанию: false
$comment_id(строка)
The comment ID as a numeric string.

Список изменений

С версии 3.8.0 Введена.

Где вызывается хук

wp_notify_postauthor()
comment_notification_notify_author
wp-includes/pluggable.php 1678
$notify_author = apply_filters( 'comment_notification_notify_author', false, $comment->comment_ID );

Где используется хук в WordPress

Использование не найдено.