• Resolved olivvv59

    (@olivvv59)


    hi,

    i can call the UM login page with my own link.

    but i use some shortcode which redirect to default wordpress login (when the user needs to be logged to use the function).
    I don’t generate these links.

    how can i tell WordPress to use UM login not the wordpress one ?
    some php code in functions.php ?

    thanks
    Olivier

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @olivvv59

    You can redirect users to the UM Login page when they visit the default WP login page with the following code snippet:

    add_action('init','um_102521_redirect_to_um_login');
    function um_102521_redirect_to_um_login(){
          global $pagenow;
          if( ! function_exists("um_get_core_page" ) ) return;
    
          if( 'wp-login.php' == $pagenow ) {
                wp_redirect( um_get_core_page("login") );
                exit();
          }
    }

    You can add the code to your theme/child-theme’s functions.php file or use the Code Snippet plugin to run the code.

    Regards,

    Thread Starter olivvv59

    (@olivvv59)

    thanks a lot.

    i had to adapt it because my logout didn’t work anymore.

    add_action('init','um_102521_redirect_to_um_login');
    function um_102521_redirect_to_um_login(){
          global $pagenow;
          if( ! function_exists("um_get_core_page" ) ) return;
    
          if( 'wp-login.php' == $pagenow ) {
            if ((isset($_GET['action']) == "logout")) {
            }
            else
            {
                wp_redirect( um_get_core_page("login") );
                exit();
            }
             
          }
    }

    like it works very good.

    • This reply was modified 3 years ago by olivvv59.
    Plugin Contributor Champ Camba

    (@champsupertramp)

    Thanks for letting us know. I’m marking this as resolved now.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘change default login page ?’ is closed to new replies.