Last active
July 7, 2020 19:31
-
-
Save dparker1005/12775b53f58fe18e71c79a87becb66a7 to your computer and use it in GitHub Desktop.
Changes membership manager so that they can only view the members list and add new members via PMPro Add Member.
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 | |
// Copy from below here... | |
/* | |
* Changes membership manager so that they can only view | |
* the members list and add new members via PMPro Add Member. | |
* | |
* Can customize using your own caps from here: | |
* https://github.com/strangerstudios/pmpro-membership-manager-role/blob/35725b5cc9d7fd403255e4143a5bd5f1564b022d/pmpro-membership-manager-role.php#L16-L42 | |
*/ | |
function my_pmprommr_change_caps( $caps ) { | |
$new_caps = array( | |
'read' => true, | |
'pmpro_memberslist' => true, | |
'edit_users' => true, | |
); | |
return $new_caps; | |
} | |
add_filter( 'pmpro_membership_manager_caps', 'my_pmprommr_change_caps' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment