pre_comment_user_agent хук-фильтрWP 1.5.0

Filters the comment author's browser user agent before it is set.

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

add_filter( 'pre_comment_user_agent', 'wp_kama_pre_comment_user_agent_filter' );

/**
 * Function for `pre_comment_user_agent` filter-hook.
 * 
 * @param string $comment_agent The comment author's browser user agent.
 *
 * @return string
 */
function wp_kama_pre_comment_user_agent_filter( $comment_agent ){

	// filter...
	return $comment_agent;
}
$comment_agent(строка)
The comment author's browser user agent.

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

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

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

wp_filter_comment()
pre_comment_user_agent
wp-includes/comment.php 2114
$commentdata['comment_agent'] = apply_filters( 'pre_comment_user_agent', ( isset( $commentdata['comment_agent'] ) ? $commentdata['comment_agent'] : '' ) );

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

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