Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Wordpress wp-comments-post.php redirect issue - please help (https://www.warriorforum.com/programming/13582-wordpress-wp-comments-post-php-redirect-issue-please-help.html)

Tony_D 19th September 2008 07:24 AM

Wordpress wp-comments-post.php redirect issue - please help
 
Hi. I'm wondering how I can add a space to the URL that wordpress redirects me to after I post a comment to an entry.

Line 80/81 of the newest version of wp-comments-post.php look like this:

$location = ( empty($_POST['redirect_to']) ? get_permalink($comment_post_ID) : $_POST['redirect_to'] ) . '#comments';
$location = apply_filters('comment_post_redirect', $location, $comment);

Right now it is redirecting me to:
http://www.websitename.com/2008/09/entrytitle#comments

I need a space before "#comments" appears in the URL, like this:
http://www.websitename.com/2008/09/entrytitle #comments

I've tried modifying line 80 in quite a few ways, I just can't get this to work the way I need. I'm really not a PHP programmer, but I get around alright when it comes to modifying existing code.

Any help????

Pete Janelle 19th September 2008 08:39 AM

Re: Wordpress wp-comments-post.php redirect issue - please help
 
Try adding "%20" as the space. If you go to a URL with a space, that's what the browser replaces it with.

http://www.websitename.com/2008/09/entrytitle%20#comments

Not sure if this will work in PHP code, but it's worth a shot.

Here's a good reference for special characters:

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

Tony_D 20th September 2008 02:21 PM

Re: Wordpress wp-comments-post.php redirect issue - please help
 
awesome, Pete. That fixed the problem perfectly. Thanks.

Pete Janelle 21st September 2008 08:47 AM

Re: Wordpress wp-comments-post.php redirect issue - please help
 
Glad to help. :)


All times are GMT -6. The time now is 02:07 PM.