Skip to content

Commit

Permalink
A simple access control plugin for WordPress
Browse files Browse the repository at this point in the history
  • Loading branch information
beastaugh committed May 24, 2008
0 parents commit 1ea3f4d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions access_control.php
@@ -0,0 +1,22 @@
<?php
/*
Plugin Name: Access Control
Plugin URI:
Description: Only allow logged-in users to view this site.
Author: Benedict Eastaugh
Version: 1.0
Author URI: http://extralogical.net/
*/

function access_control() {
if ( is_user_logged_in() || function_exists('login_header') ) {
return;
} else {
wp_redirect(get_bloginfo('wpurl') . '/wp-login.php');
exit;
}
}

add_action('init', 'access_control');

?>

0 comments on commit 1ea3f4d

Please sign in to comment.