你好:)我是个新手,但我想这至少会对你有点帮助。。。如果有任何错误,请纠正我:)I didn\'t test this code
// Block subscribers from accessing the WordPress front-end
function wpabsolute_block_users_frontend() {
if ( !is_admin() && ! current_user_can( ! \'administrator\' ) && ! wp_doing_ajax() ) {
wp_redirect( *url u want to redirect* );
exit;
}
}
add_action( \'init\', \'wpabsolute_block_users_frontend\' );