[ad_1]
@narekmarkosyan
You can try this code snippet refusing Administrators to Login
and redirect them to the Home page.
You can redirect to another page by replacing home_url() with an URL within quotes.
add_action( 'um_submit_form_errors_hook_login', 'custom_submit_form_errors_hook_login', 10, 1 );
function custom_submit_form_errors_hook_login( $args ) {
if ( UM()->user()->get_role() == 'administrator' ) {
exit( wp_redirect( home_url() ) );
}
}Install the code snippet into your active theme’s functions.php file
or use the “Code Snippets” plugin.
