//interdire l'accès aux non admins
add_action( 'current_screen', 'redirect_non_authorized_user' );
function redirect_non_authorized_user() {
// Si t'es pas admin, tu vires
if ( is_user_logged_in() && ! current_user_can( 'manage_options' ) ) {
wp_redirect( home_url() ); // on les redirige vers la home
exit();
}
}
Created
February 25, 2016 15:39
-
-
Save Antoinebr/c298bf101fd3774ae61a to your computer and use it in GitHub Desktop.
wp-redirect-subscribers
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment