Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Garconis/f0cf3b0551a35bf3b5eeffa7a02b25bb to your computer and use it in GitHub Desktop.
Save Garconis/f0cf3b0551a35bf3b5eeffa7a02b25bb to your computer and use it in GitHub Desktop.
Ultimate Member | Force allow any user to get access to WP Admin
<?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