• almerat

    (@almerat)


    Good day, Greg! Thanks for the great plugin! Please tell me how I can change the URLs of links to the admin panel. I wouldn’t want users to come into contact with it at all. That is, registration and submission of advertisements takes place only in the frontend. When in “manage” there is an output of two buttons with the message “Only logged in users can access this page.” and 2 buttons “Login” and “Register”. I somehow managed to change the address of the registration button, but the login address that leads to the panel cannot be changed. The code contains class permalink. The same goes for logout. But I don’t know how to program at all. Please tell me how to implement this?

Viewing 1 replies (of 1 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,

    you can change both links by adding the code below in your theme functions.php file or even better by creating a new blank plugin and pasting the code there

    add_filter( 'register_url', 'my_register_url' );
    function my_register_url( $url ) {
        if( is_admin() ) {
            return $url;
        }
        return "https://example.com/resgister-url/";
    }
    add_filter( 'login_url', 'my_login_url', 10, 2 );
    function my_login_url( $url, $redirect = null ) {
        if( is_admin() ) {
            return $url;
        }
        $r = "";
        if( $redirect ) {
            $r = "?redirect_to=".esc_attr($redirect);
        }
        return "https://example.com/login-url/".$r;
    }

    Just change the URLs in the above code to point to your login and registration pages.

    That said please note that your users even if they will use the default login forms will be only able to customize their profile in the wp-admin / Users panel, they will not see the Classifieds tab (actually they will see only Users tab only which allows modifiying the profile).

Viewing 1 replies (of 1 total)
  • The topic ‘All user actions in the frontend’ is closed to new replies.