notify_post_author │ хук-фильтр │ WP 4.4.0

Filters whether to send the post author new comment and note notification emails, overriding the site settings and defaults. By default, notifications are sent for all notes and for approved comments.

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

add_filter( 'notify_post_author', 'wp_kama_notify_post_author_filter', 10, 2 );

/**
 * Function for `notify_post_author` filter-hook.
 * 
 * @param bool $maybe_notify Whether to notify the post author about the new comment.
 * @param int  $comment_id   The ID of the comment for the notification.
 *
 * @return bool
 */
function wp_kama_notify_post_author_filter( $maybe_notify, $comment_id ){
	// filter...
	return $maybe_notify;
}
$maybe_notify(true|false)
Whether to notify the post author about the new comment.
$comment_id(int)
The ID of the comment for the notification.

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

С версии 4.4.0 Введена.
С версии 7.1.0 Comment approval status is checked before this filter, and the filter no longer fires for invalid comment IDs.

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

wp_new_comment_notify_postauthor()
notify_post_author
wp-includes/comment.php 2567
$maybe_notify = apply_filters( 'notify_post_author', $maybe_notify, $comment_id );

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

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