comment_edit_redirect
Filter HookDescription
Filters the URI the user is redirected to after editing a comment in the admin.Hook Information
File Location |
wp-admin/comment.php
View on GitHub
|
Hook Type | Filter |
Line Number | 377 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$location
|
The URI the user will be redirected to. |
int
|
$comment_id
|
The ID of the comment being edited. |
Usage Examples
Basic Usage
<?php
// Hook into comment_edit_redirect
add_filter('comment_edit_redirect', 'my_custom_filter', 10, 2);
function my_custom_filter($location, $comment_id) {
// Your custom filtering logic here
return $location;
}
Source Code Context
wp-admin/comment.php:377
- How this hook is used in WordPress core
<?php
372 * @since 2.1.0
373 *
374 * @param string $location The URI the user will be redirected to.
375 * @param int $comment_id The ID of the comment being edited.
376 */
377 $location = apply_filters( 'comment_edit_redirect', $location, $comment_id );
378
379 wp_redirect( $location );
380 exit;
381
382 default:
PHP Documentation
<?php
/**
* Filters the URI the user is redirected to after editing a comment in the admin.
*
* @since 2.1.0
*
* @param string $location The URI the user will be redirected to.
* @param int $comment_id The ID of the comment being edited.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-admin/comment.php
Related Hooks
Related hooks will be displayed here in future updates.