Created
May 19, 2016 13:39
-
-
Save strangerstudios/444d23ab36a9c91cc5a63d2ba817ce9a to your computer and use it in GitHub Desktop.
Only let this specific users access the Paid Memberships Pro Reports admin page.
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 | |
function my_pmpro_user_has_cap($allcaps, $caps, $args, $user) | |
{ | |
if($user->ID !== 1) | |
unset($allcaps['pmpro_reports']); | |
return $allcaps; | |
} | |
add_filter('user_has_cap', 'my_pmpro_user_has_cap', 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment