Created
March 31, 2020 16:49
-
-
Save ronalfy/5c28bde33f0e01e79aca5123ba8d536c to your computer and use it in GitHub Desktop.
Paid Memberships Pro - Add User Capability Only
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 | |
/** | |
* Remove capabilities from membership manager role. | |
* | |
* @param array $caps Array of capabilities. | |
* | |
* @return array new array of capabilities. | |
*/ | |
function pmpromm_remove_caps( $caps ) { | |
$caps = array( | |
'pmpro_memberships_menu' => true, | |
'pmpro_dashboard' => true, | |
'read' => true, | |
'edit_users' => true, | |
'view_admin_dashboard' => true, | |
); | |
return $caps; | |
} | |
add_filter( 'pmpro_membership_manager_caps', 'pmpromm_remove_caps' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment