Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress deny user to access wp-admin programmatically

function restrict_access_admin_panel(){
    global $current_user;
 
    if ($current_user->user_level <  4) {
        wp_redirect( home_url() );
        exit;
    }
}
add_action('admin_init', 'restrict_access_admin_panel', 1);
 
PREVIOUS NEXT
Tagged: #wordpress #deny #user #access #programmatically
ADD COMMENT
Topic
Name
6+7 =