darrenjacoby / intervention

WordPress plugin to configure wp-admin and application state using a single config file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work on multisite install

grahammtbr opened this issue Β· comments

Like the title says. No errors or anything, just didn't work.

Not a big deal for me, I just rolled that client back to ver. 1.3, it's fine on that version with WP's infinite backwards compatibility πŸ˜„

Hey @grahammtbr ,

So this is an interesting one. I'm assuming you're using a 'super' administrator user, viewing multisite dashboards. WordPress doesn't seem to pass any user roles for the super administrator role, or administrator role on a network level, so we're left with an empty $current_user->roles array, and therefore Intervention doesn't apply the config file. Using wp-admin.all actually did still work as it bypasses checking for user roles.

I pushed a fix to add the administrator user role manually if the array is empty and multisite is activated, 2285826. Give it a go and let me know if it solves the above issue for you!

Thanks Darren. I could have sworn I tried wp-admin-all and it didn't work, but I tried it again (with the some version) and it worked... I must have been asleep at the wheel.

Thanks for all your work on this, it's definitely appreciated. It's the config file I always wanted to create, but never got around to!

@grahammtbr hah, it happens! So, to confirm, the latest fix (on dev-master) is working as well with wp-admin.administrator? I want to make sure you get the role capabilities on multisite too. It's a pleasure, and thank you for the nice words!

Hey @grahammtbr , just checking if it's all working on your end and I can close the issue?

Sorry, missed this. Yes, it's working. Thanks!