Skip to content

Instantly share code, notes, and snippets.

@hayskytech
Created August 20, 2022 01:02
Show Gist options
  • Save hayskytech/e5c1e2b6de5ef485f34cbac89510d716 to your computer and use it in GitHub Desktop.
Save hayskytech/e5c1e2b6de5ef485f34cbac89510d716 to your computer and use it in GitHub Desktop.
<?php
add_action( 'init', function() {
if ( is_admin() && ! current_user_can( 'administrator' ) && is_user_logged_in() && ! wp_doing_ajax() ) {
wp_redirect( home_url().'/account' );
exit;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment