Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // RESTRICT ACCESS TO WP-ADMIN DASHBOARD
- function restrict_admin_access(){
- if( !current_user_can( 'edit_posts' ) ) {
- wp_redirect( home_url() );
- die();
- }
- }
- add_action( 'admin_init', restrict_admin_access, 1 );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement