comment_post_redirect filter-hookWP 2.0.5

Filters the location URI to send the commenter after posting.


add_filter( 'comment_post_redirect', 'wp_kama_comment_post_redirect_filter', 10, 2 );

 * Function for `comment_post_redirect` filter-hook.
 * @param string     $location The 'redirect_to' URI sent via $_POST.
 * @param WP_Comment $comment  Comment object.
 * @return string
function wp_kama_comment_post_redirect_filter( $location, $comment ){

	// filter...
	return $location;
The 'redirect_to' URI sent via $_POST.
Comment object.


Since 2.0.5 Introduced.

Where the hook is called

In file: /wp-comments-post.php
wp-comments-post.php 78
$location = apply_filters( 'comment_post_redirect', $location, $comment );

Where the hook is used in WordPress

Usage not found.