Skip to content

Required capability: Redirect to maintenance mode page on login #30

Description

@mikeyarce

Currently, we have the vip_maintenance_mode_required_cap filter that check's for a required capability (edit_posts by default) and if the user does NOT have that capability, it will redirect them to the Maintenance Mode page.

However, this is hooked into template_redirect so it only happens on the frontend of the site. If they log in they will still be redirected to the Dashboard. If they try to view the site, they will see the Maintenance Mode page.

I think it makes sense to redirect everywhere and not just on the frontend.

Possible use case:
I am a site Admin and I want to enable maintenance mode and restrict specific users from logging in. I add a filter to restrict all non-admins from being able to log in, and I do some maintenance tasks while confidently knowing no one else is logging in to update/change data.

Thoughts?
cc @anigeluk

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions