WooCommerce will only show the admin bar and give dashboard access to users who have the edit_posts or manage_woocommerce capabilities. If you don’t want to give users one of those capabilities, you can use the woocommerce_disable_admin_bar filter to give access and show the admin bar:
add_filter(
'woocommerce_disable_admin_bar',
function( $disable_admin_bar ) {
if ( current_user_can( 'my_capability' ) ) {
$disable_admin_bar = false;
}
return $disable_admin_bar;
}
);
Despite the name that will also give access to the dashboard, in addition to showing the admin bar.
If you only want to give dashboard access without displaying the admin bar, you can use the woocommerce_prevent_admin_access filter, which works exactly the same way, or you can give the user/role the view_admin_dashboard capability.
Related Posts:
- How to add a menu page for options in wordpress for user that has the role of vendor?
- Can I remove WooCommerce specific product categories from shop managers?
- How to update user role without logout
- In WooCommerce filter the available Payment Methods by User Role [closed]
- Admin access for custom user capabilities
- WP_Query with meta_query for children
- WooCommerce limited role
- WooCommerce Customer Role Delete Custom Post Type
- Tried to create a user role that can only edit user information, but my test account cannot view the dashboard. What am I missing?
- Allow add new post access to custom post but not wp post for some role
- WooCommerce Admin order – Only run action if user is loaded
- WooCommerce get_author_posts_url() – Author URL redirecting to shop base
- I have 3 types of prices in WP and I need to change price for each specific user role using hooks
- Switch to user link shortcode
- How to show specific admin menu to specific user role?
- Assign user role by text field in WordPress (Woocommerce) [closed]
- Need help with woocommerce roles
- How to change user role after login?
- Woocommerce customer role doesn’t change if user is already a subscriber [closed]
- How to add capabilities for editor type user to access admin section
- WooThemes – Vendors / Bookings – Allow Vendors to manage resources
- Changing second user role while updating/downgrading membership level – s2member [closed]
- How to disable the “Upgrade or Downgrade” button in “My account” of WooCommerce Subscriptions
- Restrict the shop_manager role to the WooCommerce Orders Page
- Add another user role based on a defined input field in WordPress (Woocommerce)
- Removing unwanted role after purchase
- WooCommerce get physical store address
- Filter available WooCommerce payment gateways by role [closed]
- How to hook on a WooCommerce checkout field?
- Woocommerce – How to add 5 stars to all products to test design
- Check whether user can delete a given post
- How to get woocomerce attributes thumbnail in PHP? [closed]
- Programmatically added variations not showing until clicking Update button
- How to automatically add and show all the product attributes when creating a new product
- Import products to WooCommerce by CSV page won’t open [closed]
- How can i change the design of product sizes [closed]
- How to add a user custom field into Woocommerce emails?
- WooCommerce subscription, give option to prorate or not to prorate to user while switching subscription
- Restrict Access to Posts based on Custom User and Post Meta Data
- How to handle Woocommerce API credentials
- Get product variation attribute titles – WooCommerce
- user password reset e-mail
- Extending the woocommerce product export functionality
- Custom capabilities to add, edit, remove users of a particular role only?
- Get specific values in Woocommerce Rest API
- Javascript error when adding an item to the cart [closed]
- Woocommerce: Complex query in pre_get_posts [closed]
- How can I get all the woocommerce api orders [closed]
- Switch to user link
- Customize WooCommerce Add To Cart Form Name [closed]
- Remove WooCommerce block styles
- Want to know parameters that can be passed to user_can() for access control by user capabilities
- Absolute search against wordpress api
- Is it possible to remove editor from a custom product type?
- /page/ is not working with a custom permalink structure (WooCommerce)
- Assigning multiple or additional capabilities to specific users or how to create additional roles like bbpress roles?
- User role editor – Add download files capability
- Execute PHP code only with specific user role
- How to fix the Post Preview Button (CPT & map_meta_cap)
- Restrict Custom Post Type per role in Dashboard
- Trying to run Javascript on AJAX call
- Rewrite rules for sub category (child product categry & grand-child)
- Woocommerce show field in product if product-tag is “VET” else hide
- How to make a “subtitle” for each Woocommerce product
- Create Product with Woocommerce API, but Variations are not linked
- Google Analytics gtag code messes up woocommerce cart & login
- Woocommerce API security concerns
- How to add a wrapper element on image for products page
- Dynamic subdomains for woocommerce affiliate sales but NO multisite. Is that possible?
- I wan redirect link post search to search product woocommerce?
- Limit image resolution on upload file for specific field
- Woocommerce pagination problem- page/2 = 404 solution
- Woocommerce , how to set billing_address via JS?
- Does WP-WooC support filters at database?
- How to send welcome email once user buys the subscription
- Removed Sidebar in single product page
- Reorder PRODUCTS in categories Woo
- Enable Payment gateway if ACF checkbox in user profile is checked
- Woocommerce section name? [closed]
- how to change value return by _stock_status
- Retrieve Woocommerce Cart Url with javascript/jquery [closed]
- deactivate product-page image slider on mobile
- Capabilities and mapping required for a role to be able to edit other’s posts of a custom type, BUT only be able to edit their own blog posts
- Best Roles and Capability on a site with review features using a front end custom post
- WooCommerce widget “WooCommerce Products” template [closed]
- How to get _POST variable on WooCommerce product page (form on homepage)
- Woocommerce woocommerce_breadcrumb_defaults filter [closed]
- Some Admin disappeared
- Sort by promo code used woocommerce admin panel [closed]
- Search box missing Woocommerce Product Bundle Extension
- How to display India country first in country selection drop down list in WordPress
- DatePicker in Woocommerce (My Account) Registration [closed]
- problems with an object product wooCommerce [closed]
- edit slider plugin capability for custom_role
- Sort by price when price is set in multiple keys
- Add a custom code with custom link after add to cart for every product
- WooCommerce product permalink based on product’s current category
- Disable duplicate WC product category URLs
- Add a product for all users based on a condition (WooCommerce)
- he slug “sub category” is already in use by another term