Support » Plugins » [Plugin: Theme my login] Logout URL with trailing slash doesn't complete logout

  • Resolved DanielTulp


    Using Theme my profile 6.2.2

    When I click the logout hyperlink in the Theme my login users menu in my sidebar, the URL had a trailing slash after my permalink to the login page like:…
    This seems to be working initially, but when you refresh the page or navigate to another page on the website, you’re still logged in.

    I therefor changed ‘class-theme-my-login-template.php’ in /wp-content/plugins/theme-my-login/includes
    at line 666 from:

    echo '<li><a href="' . wp_logout_url() . '">' . __( 'Log out', 'theme-my-login' ) . '</a></li>' . "\n";


    function drt_logout_url($redirect = '') {
    	$args = array( 'action' => 'logout' );
    	if ( !empty($redirect) ) {
    		$args['redirect_to'] = urlencode( $redirect );
    	$logout_url = add_query_arg($args, '../login');
    	$logout_url = wp_nonce_url( $logout_url, 'log-out' );
    	return apply_filters('logout_url', $logout_url, $redirect);
    echo '<li><a href="' . drt_logout_url() . '">' . __( 'Log out', 'theme-my-login' ) . '</a></li>' . "\n";

    this is basically just a rewrite of the wp_logout_url() function

    hope this helpes someone

    obviously, you need to change ‘../login’ to your own login permalink without trailing slash, didn’t bother to add this dynamically

Viewing 1 replies (of 1 total)
  • Thanks for the tip. I want to follow what you stated above but the version is now 6.3.8, and the line you referred to was altered I think. If I want to implement the code you suggested, where should I put it? And does it still work for the new version?


Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Theme my login] Logout URL with trailing slash doesn't complete logout’ is closed to new replies.