Change comment_reply_link URL

I have a reverse proxy pointing my WordPress Blog (CNAMED at blog.example.com) to www.example.com/blog/

Most everything is working well except for comment reply links. Those are skipping the /blog/ and going to www.example.com/category/post/, resulting in a 404.

Read More

Is there a way I can fix this without editing wp-includes files?

Related posts

Leave a Reply

1 comment

  1. The following gets called by WordPress while getting the reply link.

    apply_filters( 'comment_reply_link', $before . $link . $after, $args, $comment, $post );
    

    Use a custom filter to provide your own link. I don’t believe there is a direct way of altering just the URL, you have to inject the url into an html string yourself.

    add_filter( 'comment_reply_link', 'my_custom_callback_function', 10, 4 );
    function my_custom_callback_function($link_html, $args, $comment, $post) {
        // Return an html string here
    }