wordpress snippets last updated   : July 14, 2014
we now have 634 snippets

Restrict wp-admin access to subscribers

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will restrict wp-admin access to subscribers.

snippet :  PHPcopy
	function restrict_access_admin_panel(){
		global $current_user;
		get_currentuserinfo();
		if ($current_user->user_level <  4) {
			wp_redirect( get_bloginfo('url') );
			exit;
		}
	}
	add_action('admin_init', 'restrict_access_admin_panel', 1);
source →
jqsnipp.com | we just launched jquery snippets website