• Resolved portbox

    (@portbox)


    How can I use tml_request_lostpassword to direct my users to my custom page instead of the wp-login.php?checkemail=confirm? I can get my function to fire but simply redirecting the user to my page with wp_safe_redirect('customurl') doesn’t show the error messages. Any advice? I couldn’t find any explanations in the docs.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    You could use the site_url filter to change the URL if it is that particular URL.

    Thread Starter portbox

    (@portbox)

    I simply cannot get it to work. Does this appear correct?

    function tml_custom_lostpassword($url) {
    if ( strpos($url, 'wp-login.php') !== false || strpos($url, '/login/') !== false ) {
      	$url = str_replace('wp-login.php', 'lce-login/', $url);
    	$url = str_replace('/login/', '/lce-login/', $url);
      }
      return $url;
    }
    add_filter( 'site_url', 'tml_custom_lostpassword' );

    This still persists in my page:
    <input type="hidden" name="redirect_to" value="https://www.healthfitcorpwell.com/login/?checkemail=confirm">
    Even if I manually change the value to lce-login via the DOM Inspector to redirect to lce-login, my login page loads but does not display any errors. How do I remedy this situation?

    • This reply was modified 9 years ago by portbox.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to use tml_request_(action)?’ is closed to new replies.