• Hi. I have added the [theme-my-login] shortcode to certain pages where I want to use the login functionality. If a user is NOT logged in, and goes to example.com/wp-admin, then I would like to use the standard WordPress login page. So what I did was to remove the ‘login’ action from:

    add_action( 'tml_registered_action', function( $action ) {
    	
    	if ( 'login' === $action ) {
    		tml_unregister_action( $action );
    	}
    
    }, 10, 1 );

    But that produces a fatal error “Uncaught Error: Call to a member function get_name() on bool in /wp-content/plugins/theme-my-login/includes/shortcodes.php:45”

    Is there something else I can do to solve this?

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

    (@jfarthing84)

    remove_filter( 'site_url', 'tml_filter_site_url', 10 );
    Thread Starter Vayu Robins

    (@vayu)

    Thanks @jfarthing84 ??

    This is how I solved it:

    add_action( 'tml_registered_action', function( $action ) {
    
    	// Let users login via the WordPress wp-admin url.
    	remove_filter( 'site_url', 'tml_filter_site_url', 10, 3 );
    	
    	if ( 'register' === $action || 'resetpass' === $action || 'dashboard' === $action || 'lostpassword' === $action ) {
    
    		tml_unregister_action( $action );
    
    	}
    
    }, 10, 1 );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Keep access to wp-admin for login’ is closed to new replies.