WordPress.org

Ready to get started?Download WordPress

Forums

Theme My Login
[resolved] Can't change Log In in Menu from Log In to Sign in / Register (2 posts)

  1. daledude
    Member
    Posted 1 year ago #

    If I add a link to the login/ page using the menu editor in Appearance > Menu, it is stuck with the name "Log In". I have tried using info in other posts for filters, but I can't get it to work. Here is what I tried:

    function tml_title_filter( $title, $action ) {
    
    	if ( is_user_logged_in() ) {
    		$user = wp_get_current_user;
    		if ( 'profile' == $action )
    			$title = 'Your Profile';
    		else
    			$title = sprintf( 'Welcome, %s', $user->display_name );
    	} else {
    		switch ( $action ) {
    			case 'register' :
    				$title = 'Register';
    				break;
    			case 'lostpassword':
    			case 'retrievepassword':
    			case 'resetpass':
    			case 'rp':
    				$title = 'Password Recovery';
    				break;
    			case 'login':
    			default:
    				$title = 'Sign in / Register';
    		}
    	}
    	return $title;
    }
    add_filter( 'tml_title', 'tml_title_filter', 11, 2 );

    It displays properly Sign in / Register as the title on the page itself in the_content, and that is the name of the item I can select in Appearance > Menu and add to my 'header' menu, but it still says "Log In" when spit out in wp_nav_menu...

    http://wordpress.org/extend/plugins/theme-my-login/

  2. Jeff Farthing
    Member
    Plugin Author

    Posted 1 year ago #

    Unfortunately, the tml_title filter is not applied to the page menu object.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.