Hello, I followed the code example about prohibit access to admin, but recently, this function may redirect Admin to the home page, some plugins added roles disappeared sometime, some plugin tabs on the navigation bar were also disappeared, I noticed that you have remove this code from this article, that means you may have known this bug? Thanks
ure_role_additional_options
/**Admin access prohit added by user role editor
add_filter( ‘ure_role_additional_options’, ‘add_prohibit_access_to_admin_option’, 10, 1 );
function add_prohibit_access_to_admin_option($items) {
$item = URE_Role_Additional_Options::create_item( ‘prohibit_admin_access’, esc_html__(‘Prohibit access to admin’, ‘user-role-editor’), ‘init’, ‘prohibit_access_to_admin’ );
$items[$item->id] = $item;
return $items;
}
function prohibit_access_to_admin() {
if ( is_admin() && !wp_doing_ajax() ) {
wp_redirect( get_home_url() );
}
}
**/