Ticket #2590 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

New Filter: comment_post_redirect

Reported by: markjaquith Assigned to: markjaquith
Priority: normal Milestone:
Component: Administration Version: 2.0.4
Severity: normal Keywords: has-patch hook filter comment_post_redirect 2nd-opinion bg|commit
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

comment_post_redirect-HOOK.diff (424 bytes) - added by markjaquith on 03/23/06 00:48:13.
$location = apply_filters('comment_post_redirect', $location, $comment);
comment_post-edit_redirect.HOOKS.fragments.diff (1.4 kB) - added by Libertus on 06/07/06 15:50:30.
My take, adding a simiar filter for edited comments, and automatic redirection to the comment by fragment, which makes WordPress much nicer to use.
comment_post-edit_redirect.HOOKS.fragments-2.diff (1.3 kB) - added by Libertus on 06/07/06 16:05:02.
No direct possibility of a double fragment identifier now.
comment_redirect_filters.diff (1.4 kB) - added by markjaquith on 08/31/06 07:12:45.
Patch for /trunk/
comment_redirect_hooks_BRANCHES_2.0.diff (1.3 kB) - added by markjaquith on 09/28/06 04:37:08.
Patch for /branches/2.0/

Change History

03/23/06 00:48:13 changed by markjaquith

  • attachment comment_post_redirect-HOOK.diff added.

$location = apply_filters('comment_post_redirect', $location, $comment);

03/23/06 00:49:35 changed by markjaquith

  • keywords changed from has-patch hook filter comment_post_redirect to has-patch hook filter comment_post_redirect 2nd-opinion.
  • owner changed from anonymous to markjaquith.
  • status changed from new to assigned.

Patch is up. 2nd opinion?

03/23/06 07:55:46 changed by davidhouse

Why not.

03/23/06 07:56:24 changed by davidhouse

  • keywords changed from has-patch hook filter comment_post_redirect 2nd-opinion to has-patch hook filter comment_post_redirect 2nd-opinion bg|commit.

Err, meant to add this last time :)

06/07/06 15:22:03 changed by Libertus

Yes, please.

06/07/06 15:25:33 changed by markjaquith

Paging Ryan/Matt.

06/07/06 15:50:30 changed by Libertus

  • attachment comment_post-edit_redirect.HOOKS.fragments.diff added.

My take, adding a simiar filter for edited comments, and automatic redirection to the comment by fragment, which makes WordPress much nicer to use.

06/07/06 15:52:39 changed by Libertus

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?

06/07/06 15:57:23 changed by Libertus

Oops! Careless! Double fragment in that patch. Fixing...

06/07/06 16:05:02 changed by Libertus

  • attachment comment_post-edit_redirect.HOOKS.fragments-2.diff added.

No direct possibility of a double fragment identifier now.

08/30/06 11:21:45 changed by markjaquith

Bump for bug hunt. Still a good idea.

08/30/06 17:07:13 changed by ryan

Patch no longer applies. Needs a refresh.

08/31/06 07:12:45 changed by markjaquith

  • attachment comment_redirect_filters.diff added.

Patch for /trunk/

08/31/06 07:13:51 changed by markjaquith

Freshened the patch up.

09/28/06 04:37:08 changed by markjaquith

  • attachment comment_redirect_hooks_BRANCHES_2.0.diff added.

Patch for /branches/2.0/

09/28/06 04:37:43 changed by markjaquith

Added a patch for /branches/2.0/ for 2.0.5 consideration. Patch for trunk is still good.

09/28/06 19:16:18 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [4260]) comment_post_redirect and comment_edit_redirect from Mark J. fixes #2590

09/28/06 19:16:47 changed by ryan

(In [4261]) comment_post_redirect and comment_edit_redirect from Mark J. fixes #2590

09/28/06 19:17:07 changed by ryan

  • version changed from 2.1 to 2.0.4.
  • milestone changed from 2.1 to 2.0.5.

11/30/06 19:41:51 changed by

  • milestone deleted.

Milestone 2.0.5 deleted