Viewing 7 replies - 1 through 7 (of 7 total)
  • In wp-comments-popup.php:

    find

    $location = get_permalink($comment_post_ID);

    and replace with:

    $location = (empty($_POST[‘redirect_to’])) ? $_SERVER[“HTTP_REFERER”] : $_POST[‘redirect_to’];
    if ($is_IIS) {
    header(“Refresh: 0;url=$location”);
    } else {
    header(“Location: $location”);
    }

    Thread Starter hesed2

    (@hesed2)

    Like I said, I’m using WP 1.5, so there is no wp-comments-popup.php file. Neither is there anything with ‘$location’, ‘Location’, or ‘location’ in the comments-popup.php file.

    Oh sorry! I think it actually goes in wp-comments-post.php. My mistake.

    Thread Starter hesed2

    (@hesed2)

    Well, it doesn’t exist in that file either. I’m starting to think this is a bug in WP.

    I’ve gone over the code in wp-comments-post.php again, and the only thing I can see that may affecting this is this line (near line 54): <input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER["REQUEST_URI"]); ?>" />

    I have no idea what that really means, so I’m not sure what to do with it.

    The $location = get_permalink($comment_post_ID); should be one line up from the bottom in wp-comments-post.php. If you don’t have it then you probably need a new copy.

    Thread Starter hesed2

    (@hesed2)

    Oohhh, the file in the root WP directory! Ok, now I’m with you. All fixed, thanks a ton for you’re help.

    NP 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Popup Comment redirect’ is closed to new replies.