#2590 closed enhancement (fixed)
New Filter: comment_post_redirect
Reported by: | markjaquith | Owned by: | markjaquith |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.0.4 |
Component: | Administration | Keywords: | has-patch hook filter comment_post_redirect 2nd-opinion bg|commit |
Focuses: | Cc: |
Description
comment_post_redirect is a filter on the $location that is wp_redirect()ed after a successful comment. It also passes the $comment object as a second value.
Use case: modify the URI that people go do, to do one of many things, including passing a message. for instance, you could add ?message=1 and then have wp_head look for $_GETmessage? == "1" and do a JS alert or something. You could notify of spam, or moderation. Or, on spam or moderation, you could redirect to a captcha or something to allow someone to redeem themselves. Would really be quite useful.
Attachments (5)
Change History (20)
#1
@
19 years ago
- Keywords 2nd-opinion added
- Owner changed from anonymous to markjaquith
- Status changed from new to assigned
Patch is up. 2nd opinion?
@
19 years ago
My take, adding a simiar filter for edited comments, and automatic redirection to the comment by fragment, which makes WordPress much nicer to use.
#6
@
19 years ago
Adding the same filter after editing the comment allows that redirect code to be tidied.
I was going to use the filters so I could add the comment fragments in a plugin, but thought they might be far better in the mainline. What do you guys think?
#11
@
18 years ago
Added a patch for /branches/2.0/ for 2.0.5 consideration. Patch for trunk is still good.
$location = apply_filters('comment_post_redirect', $location, $comment);