Created
May 18, 2018 18:11
-
-
Save Garconis/f0cf3b0551a35bf3b5eeffa7a02b25bb to your computer and use it in GitHub Desktop.
Ultimate Member | Force allow any user to get access to WP Admin
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 | |
/* --- | |
By default, Ultimate Member prevents backend access unless explicitily allowed via each role | |
In fact, if they have NUMEROUS roles, and only ONE of those roles was explicitiy given backend permission, the user still won't have access since their other roles are restricting it | |
So we take THEIR OWN FUNCTION and remove it. So now it won't matter if the UM role has "wp-admin" access or not. | |
--- */ | |
function remove_um_admin_block_action() { | |
remove_action('init','um_block_wpadmin_by_user_role',99); | |
} | |
add_action('init','remove_um_admin_block_action'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment