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

Filters the comment author's URL cookie before it is set.

When this filter hook is evaluated in wp_filter_comment(), the comment author's URL string is passed.

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

add_filter( 'pre_comment_author_url', 'wp_kama_pre_comment_author_url_filter' );

/**
 * Function for `pre_comment_author_url` filter-hook.
 * 
 * @param string $author_url_cookie The comment author URL cookie.
 *
 * @return string
 */
function wp_kama_pre_comment_author_url_filter( $author_url_cookie ){

	// filter...
	return $author_url_cookie;
}
$author_url_cookie(строка)
The comment author URL cookie.

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

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

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

sanitize_comment_cookies()
pre_comment_author_url
wp_filter_comment()
pre_comment_author_url
wp-includes/comment.php 630
$comment_author_url = apply_filters( 'pre_comment_author_url', $_COOKIE[ 'comment_author_url_' . COOKIEHASH ] );
wp-includes/comment.php 2153
$commentdata['comment_author_url'] = apply_filters( 'pre_comment_author_url', $commentdata['comment_author_url'] );

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

wp-includes/default-filters.php 80
add_filter( $filter, 'wp_strip_all_tags' );
wp-includes/default-filters.php 81
add_filter( $filter, 'sanitize_url' );
wp-includes/default-filters.php 82
add_filter( $filter, 'wp_filter_kses' );