Skip to content

Instantly share code, notes, and snippets.

@cyberwani
Forked from aristath/gist:4986639
Created February 6, 2014 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyberwani/8846001 to your computer and use it in GitHub Desktop.
Save cyberwani/8846001 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Restrict administration access
Plugin URI:
Description: Restrict administration access
Author:
Version: 1.00
Author URI:
*/
add_action( 'admin_init', 'custom_wpadmin_blockusers_init' );
function custom_wpadmin_blockusers_init() {
if ( !current_user_can( 'activate_plugins' ) ) {
wp_redirect( home_url() );
exit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment