Ok, I was doing a mistake and glad that I found it! I was using admin_menu
hook when it should be admin_init
.
So the only change I had to make was:
add_action('admin_init', 'restrict_admin_access_by_role', 999);
Hope this would help somebody like me as well!
Related Posts:
- Create mobile site with same content just different theme
- How to hide or remove unwanted widgets on Multisite installation?
- How can I diagnose a slow WordPress admin?
- How to enable a site administrator to edit users in a WordPress network/ multisite setup?
- WP-Admin not working properly at WordPress multisite with subdirectories
- Security in WordPress plugin development
- Hide a theme on list of themes in wp-admin without editing core files
- Difference Between Admin and Super Admin in Database
- wp-admin slow in multisite
- Don’t allow access to wp-admin but allow admin-ajax requests to be fulfilled on frontend?
- Timeout While Upgrading Network in Multi-site
- Uploading Images to Multi-Site Causes Failure to HTTP Error
- Multisite wp-admin redirect loop
- WordPress network (multisite) /wp-admin/ redirect loop (ERR_TOO_MANY_REDIRECTS)
- Copy posts from one blog to another in multisite environment
- My subsites accidentally went from one multisite network to another. How do I change it back?
- Redirect loop (only for multisite network admin)
- Manipulate list of themes in wp-admin
- Add menu page on multisite
- How to remove the Tools menu item from the WP-Admin menu
- Creating a Post form outside of the Admin
- Subsites in Multisite installation throwing 404 error on wp-admin in IIS 7
- How to remove Broken Link Checker widget from admin menu
- How to set Active plugins as the default screen?
- Why can’t I delete original user in multisite? Options for manual removal
- Multisite network admin – URL / redirect error
- Cookie nonce is invalid – Multisite
- WordPress mutisite migration
- Removing “Sub-menus” from My Sites Drop-down in Admin Bar
- Why does the My Site dropdown show only a single domain?
- wp_redirect not working on admin menu page
- Super admin access to a forgotten WP instance?
- Iframe being removed only for some users when publishing a page
- WP Multisite with Domain Mapping : Preventing User Access to Dashboard
- Show media-frame-menu on custom Media Frame
- 2 website 1 database… Local to online
- Updated to version 3.8 and Admin pages are very slow. How to diagnose problem? [closed]
- Moving wp-admin folder to a different host in a multisite environment
- Site’s admin created with wpmu_create_blog accessible only on 2nd attempt
- How to remove and disable access to General Settings Page including its link
- Is There A Plugin to Create WP Multisite Installs programatically
- Can’t log in to wp-admin after setting up Multisite
- How to remove a CPT Menu from the Root Admin only
- Infamous admin login redirect
- WordPress multisite second site admin resulting in too many redirects error
- My Sites link in multisite is incorrect
- Multisite wp-admin redirecting to main wp-admin using NGINX
- WordPress Multisite: Login to all subsites at once
- the menu of the network does not display my second website
- How to Add Super Admin for WordPress multi-site
- network admin pages not linked to correctly
- How to have same admin login for more than one site?
- WP Admin Panel for Multi-site install not loading JavaScript for one Subdomain
- Backend freezing on certain pages of a subsite
- WordPress Multisite giving users access to specific Admin Pages
- Admin user getting redirected to /wp-admin/user
- load styles and scripts in network admin not working
- Pages redirect me to the homepage
- 4th Network Site Database Errors?
- Many big issues in the website, WP_Debug not showing
- What could be changing my WP password and blocking plugins from installing?
- What do I need to do to convert my MultiSite from HTTP to HTTPS?
- WP Multisite development with Mamp Pro and wildcard subdomains, not really working for me
- SSL wildcard issue for wp multisite subdomains
- How to set configuration options for particular sub blogs?
- Organize uploaded media files
- How to upload images manually to wordpress?
- MU domain mapping login issue
- How to make WordPress use new Upload Path settings in Multisite Setup
- WPDB Multiple site’s posts and get featured images
- Using WP CLI to set options in WP Multisite
- Transients API and multisite
- Get Permalink of Network Blog Post
- What is the best practice to get a site from local to online?
- How i can get blog info using site url in multi-site
- Embedding screencast.com Videos in WordPress Multisite
- Mapping subdomain to point to sudirectory site in WordPress Multisite Network
- Multisite multidomain
- Notice bar at frontpage for multisite
- Apache Site Aliases & WordPress Multisite
- Single sign on for several website domains
- How to create a Multi-Network subsite?
- Hierarchy in multisite
- Create default pages in wordpress multisite
- Remove superadmin role from the “change role to” menu in user listing
- use get_theme_mod from all sites in network
- How to hide Admin Tabs? [duplicate]
- Replicate network plugins without having to configure it for each subsite?
- How to organize my js files
- Installing multisite network on a bluehost addon domain
- WordPress Multisite URLs and Multiple Updates
- Multisite switch to blog
- Interchanging WordPress Multisite primary site
- Admin users not able to see network menus
- Assign user to belong to a subsite in Multisite instance
- Multisite – SMTP not working on other network sites
- WordPress Multisite redirect loop
- Multiple WordPress sites on one hosting [closed]
- WPML is blocking WP core update
- Multisite: Redirect a deleted site – Best practice?