Created
May 8, 2018 14:56
-
-
Save smartdeal/3e68bdb919c75f43e9bf3371b7857dfb to your computer and use it in GitHub Desktop.
[Remove Dashboard Access] #Wordpress
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 | |
add_action('admin_init', 'no_mo_dashboard'); | |
function no_mo_dashboard() { | |
if (!current_user_can('manage_options') && $_SERVER['DOING_AJAX'] != '/wp-admin/admin-ajax.php') { | |
wp_redirect(home_url()); exit; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment