mu-plugin that adds a special capability to a specific user that can be checked against in plugins or themes.
PHP Shell
Pull request Compare This branch is 14 commits ahead of WebDevStudios:master.
Latest commit 5fe33b2 Feb 16, 2017 @jazzsequence committed on GitHub adds link to latest raw php file

README.md

is_hm_admin

GitHub license Build Status
Contributors: jazzsequence, bradp, rmccue
Stable tag: 1.3.0
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Description

Adds a custom capability and some helper functions to determine if the current user is a privileged user.
By default, privileged users are any users with @humanmade.co.uk or @hmn.md in their email address.

Installation

  1. Download the latest version of is-hm-admin.php
  2. Upload is-hm-admin.php to the /wp-content/mu-plugins/ directory.

Changelog

1.3.0

  • Regex the domains and check if the current user email is in that list of domains. Domains can be filtered with hm_is_admin_allowed_domains.
  • Allow a user ID/object to be passed to is_hm_admin to check if a specific user is an hm_admin.
  • Other less significant changes like more wds_admin to hm_admin switches.

1.2.0

  • Adds a check for hm-proxy-access. If a user is proxied in, the check supercedes the email address check.
  • Adds an optional parameter to is_hm_admin to manually bypass the proxy check.

1.1.0

  • Refactored default privileged users to be an array of users with humanmade.co.uk or hmn.md in their email address.

1.0.0

  • First release