Question: I want to know if the shop\_manager is logged-in WP/woocommerce. I know the function is\_admin(), but do you know a way to use something like this 'is\_shop\_manager()' ?

Thanks

Answer: 
No, there is not any direct inbuilt function as shop\_manager role is coming from WooCommerce & not from WordPress, but it can be achieved with following code:

```
function is_shop_manager() {
    $user = wp_get_current_user();
    if ( isset( $user['roles'][0] ) && $user['roles'][0] == 'shop_manager' ) {
        return true;    // when user is shop manager
    } else {
        return false;   // when user is not shop manager
    }
}

if ( is_shop_manager() ) {
    // write code for shop_manager here
}

```

Hope this will be useful.
Fixed code:

```
function is_shop_manager() {
    $user = wp_get_current_user();

    if ( isset( $user->roles[0] ) && $user->roles[0] == 'shop_manager' ) {
        return true;    // when user is shop manager
    } else {
        return false;   // when user is not shop manager
    }
}

```