WordPress.org

Ready to get started?Download WordPress

Forums

Comment posting and redirect_to (2 posts)

  1. balse
    Member
    Posted 9 years ago #

    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 ;)

  2. parisinflames
    Member
    Posted 9 years ago #

    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. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.