Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'admin_init', 'redirect_non_users' );
- function redirect_non_users() {
- $user = wp_get_current_user();
- if ( array_intersect( ['author'], (array) $user->roles ) ) {
- wp_redirect( home_url() );
- exit;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement