• Resolved sediqpir

    (@sediqpir)


    I’m currently facing a challenge where the plugin is preventing vendor role users from accessing the wp-admin page. Upon login, instead of landing on the wp-admin dashboard, vendor role users are being redirected to wp-admin/profile.php. This redirection is not aligned with the intended user experience as I want my users to access the full wp-admin dashboard directly.

    Desired Outcome: I aim to ensure that vendor role users can seamlessly access the wp-admin dashboard without any redirection. However, I do intend to hide the profile.php page from my WordPress dashboard to streamline the user experience.

    Request for Support: Could you please assist me in resolving this issue? I would greatly appreciate any guidance or steps to adjust the plugin settings or configurations to allow vendor role users to access the wp-admin dashboard directly.

    Thank you for your prompt attention to this matter. Please let me know if you require any further information from my end to assist in resolving this issue.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Lloyd Rick Guyon

    (@lloydrick)

    Hi there,

    This is expected behavior on WordPress. Limited users, like vendors, will have limited WP-Admin access as they have limited capabilities.

    However, please note that we will be dropping access to the WP-Admin dashboard soon.

    I suggest utilizing the WC Vendors dashboard.

    Cheers!

    Thread Starter sediqpir

    (@sediqpir)

    Hello @lloyed Rick Guyon,

    I’ve been experimenting with some custom code to address an issue, but unfortunately, it hasn’t yielded the desired results.

    function allow_vendor_dashboard_access() {
        if ( is_user_logged_in() && current_user_can( 'vendor' ) ) {
            $current_url = esc_url( $_SERVER['REQUEST_URI'] );
            if ( $current_url === '/wp-admin/' ) { 
                wp_redirect( admin_url() );
                exit;
            }
        }
    }
    add_action( 'init', 'allow_vendor_dashboard_access' );

    Despite implementing this code, it doesn’t seem to be functioning as expected. Could you kindly provide a snippet that might resolve this issue? Your assistance would be greatly appreciated.

    Thank you!

    Thread Starter sediqpir

    (@sediqpir)

    Hello, Can you please tell me which named plugin file is responsible for preventing direction to the wp-admin page? Ill try myself to solve that.

    Thread Starter sediqpir

    (@sediqpir)

    I addressed this by making adjustments in the wc-vendors/classes/admin/class-admin-users.php file. Specifically, I commented out the following code block:

    // if ('index.php' === $pagenow) {
    //     wp_safe_redirect(admin_url('profile.php'));
    // }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin Preventing Vendor Role Users from Accessing wp-admin’ is closed to new replies.