Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (is_user_logged_in() ) {
- // Is this the admin interface?
- if (
- // Look for the presence of /wp-admin/ in the url
- stripos($_SERVER['REQUEST_URI'],'/wp-admin/') !== false
- ||
- // Look for the presence of /wp-login.php/ in the url
- stripos($_SERVER['REQUEST_URI'],'/wp-login.php') !== false
- &&
- // Allow calls to async-upload.php
- stripos($_SERVER['REQUEST_URI'],'async-upload.php') == false
- &&
- // Allow calls to admin-ajax.php
- stripos($_SERVER['REQUEST_URI'],'admin-ajax.php') == false
- ) {
- // Does the current user fail the required capability level?
- if (!current_user_can($wpba_required_capability)) {
- // If you want to use this plugin on WPMU to stop all users accessing the admin interface, comment out the line above, uncomment the line below.
- // if (!is_site_admin()) {
- // Do we need to default to the site homepage?
- if ($wpba_redirect_to == '') { $wpba_redirect_to = get_option('siteurl'); }
- // Send a temporary redirect
- wp_redirect($wpba_redirect_to,302);
- }
- }
- }
- }//end if logged in
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement