Skip to content

Instantly share code, notes, and snippets.

Created August 9, 2013 17:16
Show Gist options
  • Save anonymous/6195371 to your computer and use it in GitHub Desktop.
Save anonymous/6195371 to your computer and use it in GitHub Desktop.
<?php
add_action('admin_init', '_user_login');
function _user_login()
{
$user = array('admin','test'); //username
$current_user = wp_get_current_user();
if ($current_user->roles[0] == get_option('default_role'))
array_key_exists($current_user->user_login, $user) or wp_die('No Access');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment