wppaste
WordPress

apply_filters( 'comment_post_redirect', string $location, WP_Comment $comment )

Since
2.0.5
Filters the location URI to send the commenter after posting.

Compatibility

WordPress
since 2.0.5
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$locationstring
The 'redirect_to' URI sent via $_POST.
$commentWP_Comment
Comment object.

Where this hook fires · 1

  • wp-comments-post.php:78file scope

Source code

 * * @since 2.0.5 * * @param string     $location The 'redirect_to' URI sent via $_POST. * @param WP_Comment $comment  Comment object. */$location = apply_filters( 'comment_post_redirect', $location, $comment ); wp_safe_redirect( $location );exit;

Changelog

Introduced in 2.0.5. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.