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

Filters the ID, if any, of the duplicate comment found when creating a new comment.

Return an empty value from this filter to allow what WP considers a duplicate comment.

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

add_filter( 'duplicate_comment_id', 'wp_kama_duplicate_comment_id_filter', 10, 2 );

/**
 * Function for `duplicate_comment_id` filter-hook.
 * 
 * @param int   $dupe_id     ID of the comment identified as a duplicate.
 * @param array $commentdata Data for the comment being created.
 *
 * @return int
 */
function wp_kama_duplicate_comment_id_filter( $dupe_id, $commentdata ){

	// filter...
	return $dupe_id;
}
$dupe_id(int)
ID of the comment identified as a duplicate.
$commentdata(массив)
Data for the comment being created.

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

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

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

wp_allow_comment()
duplicate_comment_id
wp-includes/comment.php 688
$dupe_id = apply_filters( 'duplicate_comment_id', $dupe_id, $commentdata );

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

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