Created
April 10, 2015 17:34
-
-
Save acodesmith/c510ce792e12070c90f7 to your computer and use it in GitHub Desktop.
Block Subscribers from wp-admin
This file contains hidden or 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
function block_subs_func(){ | |
//checks for permission | |
if ( ! current_user_can( 'edit_posts' ) ){ | |
wp_redirect( site_url() ); | |
exit; | |
} | |
} add_action('admin_init', 'block_subs_func'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks to Pat Eason for the snippet help.
http://pateason.com/