WordPress Dashboard block only for administrators
When in WordPress, a user registers access to the Dashboard, although at first only access to the options that are allowed depending on the role that has assigned in many occasions we may be interested that they can not access, for this we must put the following code to our functions.php
add_action( 'init', 'blockusers_init' ); function blockusers_init() { if ( is_admin() && ! current_user_can( 'administrator' ) ) { wp_redirect( home_url() ); exit; } }
Pingback: fuck google