Created
September 9, 2016 10:34
-
-
Save kilbot/6fa518797bd985e7eead651a7f7354ef to your computer and use it in GitHub Desktop.
Allow customer edit on WordPress multisite
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
| <?php | |
| // change the CASHIER_ID, and | |
| // add to your functions.php file | |
| add_filter('map_meta_cap', 'wc_pos_map_meta_cap', 10, 3); | |
| function wc_pos_map_meta_cap($caps, $cap, $user_id){ | |
| if(is_pos() && $cap == 'edit_users' && $user_id === CASHIER_ID){ | |
| $caps = array('edit_users'); | |
| } | |
| return $caps; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment