- This topic has 0 replies, 1 voice, and was last updated 5 months, 3 weeks ago by .
Viewing 0 reply threads
Viewing 0 reply threads
- You must be logged in to reply to this topic.
Welcome › mkmcst community Forum › Web programming › WordPress › buddypress › Block WP-Admin Area from Non-Administrators
add_action( 'admin_init', function() {
if ( ! current_user_can( 'administrator' ) ) {
wp_redirect( home_url() );
exit;
}
} );