Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Redirect back to homepage and not allow access to
- * WP admin for Subscribers.
- */
- function jay_redirect_admin(){
- if ( ! current_user_can( 'edit_posts' ) ){
- wp_redirect( site_url('/my-account') );
- exit;
- }
- }
- add_action( 'admin_init', 'jay_redirect_admin' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement