/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if ( is_user_logged_in() && is_admin() ) { global $current_user; get_currentuserinfo(); $user_info = get_userdata($current_user->ID); if ( $user_info->wp_user_level == 0 ) { header( 'Location: '.get_bloginfo('home').'/wp-login.php?redirect='.get_bloginfo('home').'/wp-admin/' ); } }
URL: http://wpsnipp.com/index.php/admin/prevent-access-to-wpadmin/