Created
October 18, 2018 13:30
-
-
Save conschneider/01796bee18c9bd8978854cd15b581b6b to your computer and use it in GitHub Desktop.
Only allows super admins into the WordPress dashboard.
This file contains 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
function cs_super_admin_access(){ | |
if ( ! defined( 'DOING_AJAX' ) && ! is_super_admin () ) { | |
wp_redirect( home_url() ); | |
die(); | |
} | |
} | |
add_action( 'admin_init', 'cs_super_admin_access', 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment