Use the clean url
filter to add the new link in an evil way.
add_filter( 'clean_url', 'wpse_99251_add_anchor_to_login_form', 10, 2 );
/**
* Add an anchor (link) to the login form.
*/
function wpse_99251_add_anchor_to_login_form( $good_protocol_url, $original_url ) {
// Check to see if we are on the login page and escaping the "Lost Password?" url.
if ( 'wp-login.php' == $GLOBALS['pagenow'] && $original_url == wp_lostpassword_url() ) {
// If we get here, we are inside the href atribute of the lost password anchor.
// So, the anchor we add starts in its middle.
return sprintf(
'%s" title="%s">%s</a> | <a href="%s',
esc_url( 'https://my_link' ), // Change to your link url.
esc_attr( 'My Link Title' ), // Change to your link title.
'My Link Name', // change to your link name.
$good_protocol_url
);
}
return $good_protocol_url;
}