WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Right now there is a link and I am using a plugin for a modal box and I would like to change the link in the code.

Where is the html and php file with the code located?

I have looked in my theme files, but comments.php do not contain the code I need to change.

Can I hack it via functions.php hook?

share|improve this question
up vote 2 down vote accepted

the link is called from within comment_form() (/wp-includes/comment-template.php line 1539) :

'must_log_in'          => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',

and uses wp_login_url() (/wp-includes/general-template.php lines 224+) which uses a filter on its return:

 return apply_filters('login_url', $login_url, $redirect);

you might be able to add a filter function to functions.php of your theme, to influence the link; example:

add_filter( 'link_url', 'wpse_71100_linkchanger');
function wpse_71100_linkchanger( $link ) {
  /*whatever you need to do with the link*/
  return $link;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.