Support » Requests and Feedback » Comment posting and redirect_to

  • balse

    (@balse)


    When I tried to post a comment using the popup window it redirected to the post page after sending it. So I checked WP’s code and found that it wasn’t using the redirect_to.
    In order to solve this problem, I inserted these lines into wp-comments-post.php, just below the line $location = get_permalink($comment_post_ID);

    if (isset($_POST["redirect_to"])) {
    $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $_POST['redirect_to']);
    }

    It would be nice to include this on WP 😉

Viewing 1 replies (of 1 total)
  • parisinflames

    (@parisinflames)

    THANK YOU! I’ve been searching EVERYWHERE for something to help me with this problem! You are a lifesaver!! *bows down*
    You might want to point out that the code will work when the two
    ‘s are taken out of the code. 😉

Viewing 1 replies (of 1 total)
  • The topic ‘Comment posting and redirect_to’ is closed to new replies.