comment_notification_recipients хук-фильтрWP 3.7.0

Filters the list of email addresses to receive a comment notification.

By default, only post authors are notified of comments. This filter allows others to be added.

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

add_filter( 'comment_notification_recipients', 'wp_kama_comment_notification_recipients_filter', 10, 2 );

/**
 * Function for `comment_notification_recipients` filter-hook.
 * 
 * @param string[] $emails     An array of email addresses to receive a comment notification.
 * @param string   $comment_id The comment ID as a numeric string.
 *
 * @return string[]
 */
function wp_kama_comment_notification_recipients_filter( $emails, $comment_id ){

	// filter...
	return $emails;
}
$emails(string[])
An array of email addresses to receive a comment notification.
$comment_id(строка)
The comment ID as a numeric string.

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

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

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

wp_notify_postauthor()
comment_notification_recipients
wp-includes/pluggable.php 1675
$emails = apply_filters( 'comment_notification_recipients', $emails, $comment->comment_ID );

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

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