Redirect users to their just-posted comment
-
Currently, if a visitor posts a comment, they’re redirected to the post itself. This usually means that they’ll end up at the TOP of the page, which is very likely NOT where their comment is. IMHO, this is a bug (I’d file a report + fix on Mosquito, but somehow it barfs on the database connection), or at the very least an inconvenience: I’d expect to be taken to my comment (which is what, for example, PHPBB does — not that I’m PHPBB’s biggest fan, but a lot of people use it and are used to it’s behaviour).
Luckily, the fix is very easy.
1. Open wp-comments-post.php (in the wordpress “root” directory)
2. Locate the last line of code (in my install it’s line 55, which says “header(“Location: $location”);”)
3. Change it to: header(“Location: $location#comment-“.$wpdb->insert_id);
4. Save, and congratulate yourself on a job well done. =]How do others see this issue, anyway? Is this a bug, or am I just being quirky here? In other words, if Mosquito comes back up, should I file a bug, or a request, or shouldn’t I bother at all?
- The topic ‘Redirect users to their just-posted comment’ is closed to new replies.