Skip to content

Instantly share code, notes, and snippets.

@femiyb
Created August 2, 2021 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save femiyb/578ea1ca51b935a1c29712f297863aab to your computer and use it in GitHub Desktop.
Save femiyb/578ea1ca51b935a1c29712f297863aab to your computer and use it in GitHub Desktop.
Give Shop Managers access to dashboard
<?php
/**
* This will Give WooCommerce Sho[p Managers access to the dashboad of you are removing access for other users
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function shop_manager_show_admin_bar() {
if(current_user_can('shop_manager')) {
add_filter( 'show_admin_bar', '__return_true' );
}
}
add_action('init', 'shop_manager_show_admin_bar', 9);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment