Created
October 14, 2012 12:18
-
-
Save remkus/3888385 to your computer and use it in GitHub Desktop.
No WordPress Dashboard Access
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
| add_action( 'init', 'no_wp_admin_for_lesser_gods' ); | |
| /** | |
| * This will redirect anyone without an administrator | |
| * lever user to the front of the site. No Dashboard for them. | |
| * | |
| * @author Remkus de Vries | |
| * @access public | |
| * | |
| */ | |
| function no_wp_admin_for_lesser_gods() { | |
| if ( is_admin() && ! current_user_can( 'administrator' ) ) { | |
| wp_redirect( home_url() ); | |
| exit; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment