I was editing a wordpress theme. Where i need to replace default wp login link with custom login link.
Problem is, comment_reply_link()
function is returning the default link. And i dont want to edit wp-include/comment-template.php
Is there any other way, so that without manipulation of any wordpress file i can replace the default login url.
I already had tried
apply_filters('login_url', $login_url,get_permalink());
before calling comment_reply_link()
. But it is not filtering resulting URL.
you can simple make a check if user is logged in and show him the reply button, if is not you can show him a custom link to your login file.
something like this:
I am not sure if you copy/pasted wrong line or misunderstanding how to add filter.
apply_filters()
runs actual hook, to attach your function to the hook you useadd_filter()
.It should be something like that: