Created
May 13, 2015 10:57
-
-
Save woogist/f45fda1df35133bb0b06 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wc_allow_subscriber_admin_access( $prevent ) { | |
$user = get_userdata( get_current_user_id() ); | |
$role = $user->roles[0]; | |
if ( $role == 'subscriber' ) { | |
return false; | |
} | |
return $prevent; | |
} | |
add_filter( 'woocommerce_prevent_admin_access', 'wc_allow_subscriber_admin_access' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment