Home Forums WoodMart support forum To Remove The Vendor Dashboard

To Remove The Vendor Dashboard

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35630

    koystrubvs
    Participant

    //If user = customer, remove the tab on the Vendor Dashboard, but the code is not working. Why?

    function is_user_role( $role, $user_id = null ) {
    $user = is_numeric( $user_id ) ? get_userdata( $user_id ) : wp_get_current_user();

    if( ! $user )
    return false;

    return in_array( $role, (array) $user->roles );
    }

    // Пример использования для текущего пользователя
    if( is_user_role( ‘customer’ ) ) {
    function my_woocommerce_account_menu_items($items) {
    unset($items[‘dokan’]); // убрать вкладку Консоль
    return $items;
    }
    add_filter( ‘woocommerce_account_menu_items’, ‘my_woocommerce_account_menu_items’, 100 );

    #35679

    Artem Temos
    Keymaster

    Hi,

    Sorry, but we don’t know how this code should work so we can’t help you. But we will fix this issue in our next theme update and the vendors dashboard links will be shown for vendors only.

    Regards

Viewing 2 posts - 1 through 2 (of 2 total)