[sourcecode language=”php”]
add_action( ‘init’, ‘kw_wp_admin_init’ );
function kw_wp_admin_init() {
if ( is_admin() && ! current_user_can( ‘administrator’ ) ) {
wp_redirect( home_url() );
exit;
}
}
[/sourcecode]