Last active
August 29, 2015 14:11
-
-
Save flistefliste/daab850404b670840cf9 to your computer and use it in GitHub Desktop.
Function is_shop_manager() for WooCommerce
This file contains 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
<?php | |
// function is shop manager | |
function is_shop_manager() { | |
global $current_user; | |
$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 | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment