You need to register/enqueue your admin scripts on admin_enqueue_scripts
, not on wp_enqueue_scripts
. wp_enqueue_scripts
is a front end hook. It won’t run on the admin pages.
Secondly, is_admin()
just checks whether the page is an admin page, not whether the user is an administrator. To check whether the user is an administrator use:
$current_user = wp_get_current_user();
if (user_can( $current_user, 'administrator' )) {
// user is an admin
}
Reference:
http://codex.wordpress.org/Function_Reference/user_can
http://codex.wordpress.org/Function_Reference/wp_get_current_user