WordPress plugin intelligence profile

mmbrs

Restrict content access using shortcodes; based on roles, capabilities, user meta, and logged in status.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 4.0
Current version1.0
WordPress coverageTested up to WordPress 4.0
Minimum stackWP 3.3 · PHP —
Directory statusactive
Last directory update2 Oct 201412y ago
Active installations10Adoption metric — not a quality score
WordPress.org rating5.0 / 5 from 1 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records mmbrs version 1.0 as active, updated 12y ago and tested up to WordPress 4.0.

Overview

About this plugin

The mmbrs plugin allows you to restrict content access using shortcodes.

Content may be restricted based on role, capability, user meta, and logged-in status.

What makes mmbrs different:

  • Restriction based on role, capability, user meta, and logged-in status is

all in one place.

  • You are able to restrict content based on if a user is=’not’. For

example, Show this content if a user is not an administrator.

  • You can pass multiple variables to the roles and capabilities shortcodes.

For example, Show this content to users who are subscribers,

contributors, or editors.

  • By default, any content within these four shortcodes is not displayed in

feeds. You may also set the showinfeed=’yes’ attribute to show the

content in feeds.

  • It is as lean as I could get it, with logic ordering to cut down on

processing. Which isn’t saying much, but if you’ve got suggestions, I’m

open to hearing them.

The four mmbrs shortcodes are:

  • [mmbrs_logged_in]
  • [mmbrs_roles]
  • [mmbrs_capabilities]
  • [mmbrs_user_meta]

[mmbrs_logged_in]

>

[/mmbrs_logged_in]

  • Attribute: none
  • Shows content to logged in users.

>

[/mmbrs_logged_in]

  • Attribute: is
  • Optional.
  • is only accepts not.
  • Shows content to logged out users.
  • Case insensitive.

>

[/mmbrs_logged_in]

  • Attribute: showinfeed
  • Optional.
  • showinfeed only accepts yes.
  • Shows content in the feed and ignores all other attributes when displaying in the feed. (If it is not being displayed in a feed, all of the attributes take effect.)
  • Case insensitive.

[mmbrs_roles]

>

[/mmbrs_roles]

  • Attribute: none
  • Returns nothing.

>

[/mmbrs_roles]

  • Attribute: equals
  • Required.
  • Accepts multiple. e.g. equals=’subscriber,contributor’
  • Shows content to users with the ‘subscriber’ role.
  • Case sensitive.

>

[/mmbrs_roles]

  • Attribute: is
  • Optional.
  • Shows content to users who do not have the ‘subscriber’ role.
  • is only accepts not.
  • Case insensitive.

>

[/mmbrs_roles]

  • Attribute: showinfeed
  • Optional.
  • Shows content in the feed and ignores all other attributes when displaying in the feed. (If it is not being displayed in a feed, all of the attributes take effect.)
  • showinfeed only accepts yes.
  • Case insensitive.

[mmbrs_capabilities]

>

[/mmbrs_capabilities]

  • Attribute: none
  • Returns nothing.

>

[/mmbrs_capabilities]

  • Attribute: can
  • Required.
  • Shows content to users with the ‘delete_others_posts’ capability.
  • Accepts multiple. e.g. can=’delete_others_posts,edit_others_posts’
  • Case sensitive.

>

[/mmbrs_capabilities]

  • Attribute: is
  • Optional.
  • Shows content to users who do not have the ‘delete_others_posts’ capability.
  • is only accepts not.
  • Case insensitive.

>

[/mmbrs_capabilities]

  • Attribute: showinfeed
  • Optional.
  • Shows content in the feed and ignores all other attributes when displaying in the feed. (If it is not being displayed in a feed, all of the attributes take effect.)
  • showinfeed only accepts yes.
  • Case insensitive.

[mmbrs_user_meta]

>

[/mmbrs_user_meta]

  • Attribute: none
  • Returns nothing.

>

[mmbrs_user_meta key=’first_name’][/mmbrs_user_meta]

  • Attribute: key (with no content)
  • Required. ( key attribute is required. Content is not required.)
  • Shows a logged-in user’s first_name meta value.
  • Does NOT accept multiple values when content is null/empty.
  • Case sensitive.

>

[/mmbrs_user_meta]

  • Attribute: key (with content)
  • Required. ( key attribute is required. Content is not required.)
  • Shows content to logged-in user with the first_name meta value.
  • Accepts multiple as OR. e.g. key=’first_name,last_name’
  • Case sensitive.

>

[/mmbrs_user_meta]

  • Attribute: is
  • Optional.
  • Shows content to users who do not have the first_name meta value.
  • is only accepts not.
  • Case insensitive.

>

[/mmbrs_user_meta]

  • Attribute: equals
  • Required.
  • Shows content to users who do not have the first_name user meta of ‘Ben’.
  • Case sensitive.

>

[/mmbrs_user_meta]

  • Attribute: showinfeed
  • Optional.
  • Shows content in the feed and ignores all other attributes when displaying in the feed. (If it is not being displayed in a feed, all of the attributes take effect.)
  • showinfeed only accepts ‘yes’.
  • Case insensitive.

Other Notes:

For every shortcode, except [mmbrs_logged_in], if a user is not logged in, the shortcode will return nothing. [/mmbrs_logged_in]

By default, everything is hidden from feeds unless showinfeed=’yes’ is defined.

Motivation for this plugin:

I wrote this plugin to fill some holes, reduce some unnecessary functions, and fix some minor bugs I found in other plugins. I now use this, and only this, to control all shortcode-based content access on my membership-style websites.

The Members plugin checks roles by checking capabilities. You are not supposed to do that. The proper way of checking roles is included here.

Notes on this:

  • WordPress current_user_can() Notes

Aside from that, I love and use the Members plugin and suggest you check it out for other role- and capability-based content access management.

I removed a bunch of stuff from the User Meta Shortcodes plugin that I didn’t want. If you want the additional functionality, I recommend that plugin.

In the end, I wanted very clear control of in-post content via shortcodes. I wasn’t finding anything that was totally stripped down. So I wrote this.

Inspiration and Credits:

  • Members Plugin
  • User Meta Shortcodes Plugin
  • AppThemes User Role Function
WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • content access
  • capabilities
  • capability
  • member
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 4.0

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 4.0.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to4.0
Minimum requirementsWordPress 3.3 · PHP not listed
Update activity2 Oct 201412y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.