Hello @niyht ,
Unfortunately, the plugin does not provide a nice option for that, but I will work on this in the next version of the plugin.
In the meantime a possible workaround would be:
1. Adding role names as classes to the body
element
2. Adding additional CSS to the theme for hiding the bar for specific roles.
In details:
1. By adding the following snippet to the current theme’s functions.php
file it is possible to add more classes to the body
HTML element:
add_filter( 'body_class', 'my_body_class' );
function my_body_class( $classes ) {
$roles = wp_get_current_user()->roles;
$classes = array_merge( $classes, $roles );
return $classes;
}
It is important to check that there is no name conflict between the original class names and the new ones generated from the role names.
2. On the theme customization page we can add the following additional CSS:
body:not(.administrator) #mobile-contact-bar,
body:not(.vendor-admin) #mobile-contact-bar {
display: none;
}
I have no Product Vendor plugin installation, so I am not sure about if vendor-admin
is the proper role name.
Let me know how it goes, or need any help.