How make this code add target=_blank on return, so when user clicks they will be redirected?
add_filter( 'wpmem_forgot_link', 'my_forgot_link', 10, 2 );
function my_forgot_link( $link, $tag ) {
// Using home_url() instead makes your filter portable.
return 'http://test.com/wp-login.php?action=lostpassword';
}
>Solution :
You should be using the wpmem_forgot_link_str hook instead, which would allow you to add target="blank" to the HTML being generated.
An example of what you’d need:
add_filter( 'wpmem_forgot_link_str', 'my_forgot_link_str', 10, 2 );
function my_forgot_link_str( $str, $link ) {
return "<a href=\"$link\" target=\"blank\">Forgot your password?</a>";
}