comment_edit_redirect
云策文档标注
概述
comment_edit_redirect 是一个 WordPress 过滤器钩子,用于在管理员编辑评论后重定向用户到指定 URI。它允许开发者自定义重定向行为。
关键要点
- 过滤器钩子名称为 comment_edit_redirect,用于修改编辑评论后的重定向 URI。
- 接受两个参数:$location(重定向 URI 字符串)和 $comment_id(被编辑评论的 ID)。
- 在 WordPress 2.1.0 版本中引入。
原文内容
Filters the URI the user is redirected to after editing a comment in the admin.
Parameters
$locationstring-
The URI the user will be redirected to.
$comment_idint-
The ID of the comment being edited.
Source
$location = apply_filters( 'comment_edit_redirect', $location, $comment_id );
Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |