Created
November 22, 2012 20:26
-
-
Save wpmark/4132813 to your computer and use it in GitHub Desktop.
Check User is a Blog User on Network Site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* protects site from those who are not assigned to it */ | |
function mdw_user_has_blog_role() { | |
/* get the global blog id */ | |
global $blog_id; | |
/* check user is part of this blog, and die if they are not */ | |
if( ! is_blog_user( $blog_id ) ) | |
wp_die( __("You are trying to access a site that you are not allowed to see. Naughty you!") ); | |
} | |
add_action( 'init', 'mdw_user_has_blog_role' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment