Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Comment Redirect to Old Page

Discussion in 'Misc WordPress Requests' started by jemar707, Nov 11, 2017.

  1. jemar707

    Guest

    Comment Redirect to Old Page, by jemar707

    Old problem seems to have resurfaced with latest updates. This thread describes behavior similar to what I am having.

    https://wordpress.org/support/topic/comment-pages-wrong-redirect/

    When a person comments on a post with more than one page of comments, they are redirected to an old page of comments, back in March. The new comment ends up on the latest page, but the person submitting the comment would end up on an old page.

    Using the “fix” from the old issue seems to have corrected the problem for me, but I thought it should be noted as I don’t really just want to add another line of code to my functions. But I did…for now.

    This is what worked:

    add_filter(‘comment_post_redirect’, ‘redirect_after_comment’);
    function redirect_after_comment($location) {
    return $_SERVER[“HTTP_REFERER”];
    }

    Is there a WordPress Ticket for this being a known issue?

    Comment Redirect to Old Page
     
    #1

Share This Page

Web Hosting