I have set up an ecommerce site using wordpress/woocommerce and am now adding the users who will be dealing with the orders to the site. The only part of the site that they need to have access to is the woocommerce orders page in the admin side.

Is there a way I can set this as the default area they see on log in? And restrict the rest of the admin side as off limits? I

Thanks in advance for any advice!

1 Answer
1

You set a custom url after rewrite from a login.

A small example, usable in a template of the theme to login.

            <?php
            $redirect = esc_url( 'your-url' );
            if ( ! is_user_logged_in() ) {
                $link = '<a href="' . get_option( 'siteurl' ) . '/wp-login.php?redirect_to=' . home_url(
                        "https://wordpress.stackexchange.com/"
                    ) . '">' . esc_attr__( 'Login', 'documentation' ) . '</a>';
            } else {
                $link = '<a href="' . get_option( 'siteurl' ) . "https://wordpress.stackexchange.com/" . $redirect . '">' . esc_attr__(
                        'Administration', 'documentation'
                    ) . '</a>';
            }
            echo apply_filters( 'loginout', $link );
            ?>

Also you can use the default hook after login from default login forms, like

// Create new rewrite rule
add_action( 'init', 'fb_rewrite' );
function fb_rewrite() {

    add_rewrite_rule( 'login/?$', 'wp-login.php', 'top' );
}

That should usable in a custom plugin.

Leave a Reply

Your email address will not be published. Required fields are marked *