I have a solution for it ( maybe not good solution but it worked fine for me )
Thanks for your enthusiasm, but you are correct – it’s not a good solution. Making changes directly to the plugin is a bad practice for a number of reasons.
Do you see the “apply_filters” in the line you are referencing? Anytime you see that in WordPress or a plugin, that is a filter hook. That means you can make a custom function to filter this element without making changes to the actual plugin.
You can “hook” into this section of the code with a call to “add_filter“, naming the filter hook (tag) and what function you want to call.
The filter tag is always the first parameter – in this case “wpmem_forgot_link”, which, is a hook placed there for the specific purpose of filtering (changing) the logout link. In this simple filter, there is only one parameter passed and that is the link.
The correct way of handling this would be to place the following in your functions.php file:
/**
* adds a filter for wpmem_forgot_link,
* calls the function my_forgot_link
*/
add_filter( 'wpmem_forgot_link', 'my_forgot_link' );
/**
* this function accepts the one parameter that this filter passes
* and returns the value that you want.
*/
function my_forgot_link( $link ) {
return home_url() . '/wp-login.php?action=lostpassword';
}
Now you’ve changed the link without changing the plugin, preventing you from (a) breaking the plugin, and (b) using a method that allows you to upgrade without having to re-hack the plugin (which we all know leads to not upgrading, thus missing out on security updates, leading to a hacked site – and that’s not fun).
This plugin is loaded with filter hooks (and action hooks) so it is very customizable. The plugin’s support site has a full list of hooks in the plugin and associated documention.