Last active
August 29, 2015 14:25
-
-
Save szbl/efc5d2c2b9ae1cf87e5a to your computer and use it in GitHub Desktop.
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
<?php | |
add_action( 'admin_init', 'szbl_redirect_subscribers' ); | |
function szbl_redirect_subscribers() | |
{ | |
$redirect_url = site_url( '/where-to-go/' ); | |
if ( is_user_logged_in() ) | |
{ | |
if ( !current_user_can( 'edit_posts' ) ) | |
{ | |
wp_redirect( $redirect_url, 303 ); | |
die; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment