comment_post_redirect
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;
}
- $location(строка)
- The 'redirect_to' URI sent via $_POST.
- $comment(WP_Comment)
- Comment object.
Список изменений
| С версии 2.0.5 | Введена. |
Где вызывается хук
В файле: /wp-comments-post.php
comment_post_redirect
wp-comments-post.php 78
$location = apply_filters( 'comment_post_redirect', $location, $comment );