GithubHelp home page GithubHelp logo

members's Introduction

Members

Members is a plugin that extends your control over your blog. It's a user, role, and capability management plugin that was created to make WordPress a more powerful CMS.

It puts you in control over permissions on your site by providing a user interface (UI) for WordPress' powerful role and cap system, which is traditionally only available to developers who know how to code this by hand.

Plugin Features

  • Role Manager: Allows you to edit, create, and delete roles as well as capabilities for these roles.
  • Multiple User Roles: Give one, two, or even more roles to any user.
  • Explicitly Deny Capabilities: Deny specific caps to specific user roles.
  • Clone Roles: Build a new role by cloning an existing role.
  • Content Permissions: Gives you control over which users (by role) have access to post content.
  • Shortcodes: Shortcodes to control who has access to content.
  • Widgets: A login form widget and users widget to show in your theme's sidebars.
  • Private Site: You can make your site and its feed completely private if you want.

Professional Support

If you need professional plugin support from me, the plugin author, you can access the support forums at Theme Hybrid, which is a professional WordPress help/support site where I handle support for all my plugins and themes for a community of 75,000+ users (and growing).

Copyright and License

This project is licensed under the GNU GPL, version 2 or later.

2009 – 2018 © Justin Tadlock.

Documentation

The relationship of users, roles, and capabilities

This is the most important thing to understand with this plugin. It's so important that I took the time out of my day to write a complete tutorial on understanding this: Users, roles, and capabilities in WordPress. If you don't understand this concept, you won't understand what this plugin does. This is not a concept created by the plugin. This is how it's done in WordPress.

I highly recommend reading that blog post, but here's the short version:

  • Users are people that have registered on your site. I'm sure you already knew that. In WordPress, users are assigned a specific role. This role defines what the user can/can't do.
  • Roles are a way of grouping users. Each user on your site will have a specific role. Roles are a set of capabilities. It is important to note that roles are not hierarchical. For example, "Administrator" is not higher than "Subscriber" in WordPress. You could literally give the Subscriber role more capabilities than the Administrator role. It's very important that you grasp this concept.
  • Capabilities give meaning to roles. It's a permissions system. They're a way of saying a role can do something or a role can't do something (e.g., Role A can edit_posts, Role B can't activate_plugins, etc.).

How to use the plugin

This plugin is set up to have a components-based system. The reason for this is that I don't want to stick everyone with a bunch of features they don't need. There's no point in using the Role Manger feature if all you need is just a login widget and some shortcodes. So, it's a use-only-what-you-want system.

To activate certain features, look for the "Members" link under your "Settings" menu while in your WordPress admin. When on the new page, you'll be able to select the features you want to use.

I recommend at least activating Role Manager feature. It is at the heart of this plugin, and many other features will likely require its use in some form.

Role management

The Role Manager feature allows you to edit and add new roles as well as add and remove both default capabilities and custom capabilities from roles. It is an extremely powerful system.

Any changes you make to users and roles using this feature are permanent changes. What I mean by this is that if you deactivate or uninstall this plugin, the changes won't revert to their previous state. This plugin merely provides a user interface for you to make changes directly to your WordPress database. Please use this feature wisely.

Editing/Adding Roles

This feature can be both a blessing and a curse, so I'm going to ask that you use it wisely. Use extreme caution when assigning new capabilities to roles. You wouldn't want to grant Average Joe the edit_plugins capability, for example.

You can find the settings page for this feature under the "Users" menu. It will be labeled "Roles". When clicking on the menu item, you'll be take to a screen similar to the edit post/page screen, only it'll be for editing a role.

In the "Edit Capabilities" box on that screen, you simply have to tick the checkbox next to the capability you want to grant or deny.

Grant, deny, or neither?

Every capability can have one of three "states" for a role. The role can be granted, denied, or simply not have a capability.

  • Granting a capability to a role means that users of that role will have permission to perform the given capability.
  • Denying a capability means that the role's users are explicitly denied permission.
  • A role that is neither granted nor denied a capability simply doesn't have that capability.

Note: When assigning multiple roles to a single user that have a conflicting capability (e.g., granted publish_posts and denied published_posts cap), it's best to enable the denied capabilities override via the Members Settings screen. This will consistently make sure that denied capabilities always overrule granted capabilities. With this setting disabled, WordPress will decide based on the last role given to the user, which can mean for extremely inconsistent behavior depending on the roles a user has.

How denied capabilities work

Suppose the Super role is granted these capabilities:

  • edit_posts

Then, suppose the Duper role is granted these capabilities:

  • publish_posts
  • edit_products

Now, further suppose User A has the Super role because you want them to edit posts. However, you also want User A to be able to edit products so you assign them the Duper role. Suddenly, User A is granted the following capabilities:

  • edit_posts
  • publish_posts
  • edit_products

For whatever reason you don't ever want users with the Super role to be able to publish posts. Now you have a problem. One way to solve this is to create a third role with just the caps that you want and give that single role to User A. However, that becomes cumbersome on larger sites with many roles.

Instead, you could explicitly deny the publish posts capability to the Super role. When you do that, User A is only granted the following capabilities:

  • edit_posts
  • edit_products

And is denied the following capabilities:

  • publish_posts

Multiple user roles

You can assign a user more than one role by going to that edit user screen in the admin and locating the "Roles" section. There will be a checkbox for every role.

You can also multiple roles to a user from the add new user screen.

On the "Users" screen in the admin, you can bulk add or remove single roles from multiple users.

Content permissions feature

The Content Permissions feature adds an additional meta box on the post editing screen.

For any public post type (posts, pages, etc.), you'll see a "Content Permissions" meta box on the post editing screen. This meta box allows you to select which roles can view the content of the post/page. If no roles are selected, anyone can view the content. The post author, users that can edit the post, and any users of roles with the restrict_content capability can always view the post, regardless of their role.

You can add a custom error message for individual posts. Otherwise, the error message will default to whatever you have set under the plugin settings.

Big important note: This feature only blocks the post content (that's what you write in the post editor), post excerpt, and post comments. It does not block anything else.

Shortcodes

There are several shortcodes that you can use in your post editor or any shortcode-ready area..

[members_access]

The [members_access] shortcode is for hiding content from particular roles and capabilities. You need to wrap your content when using this shortcode:

[members_access role="editor"]Hide this content from everyone but editors.[/members_access]

The plugin accepts the following parameters (mixing and matching won't work):

  • role - A single or comma-separated list of roles.
  • capability - A single or comma-separated list of capabilities.
  • user_name - A single or comma-separated list of usernames.
  • user_id - A single or comma-separated list of user IDs.
  • user_email - A single or comma-separated list of user email addresses.

Parameters:

  • capability: A capability that has been assigned to a role.
  • role: A user role from WordPress or one that you've created.
  • operator: Accepts ! to negate the role or capability.

Note that capability and role parameters aren't used in conjunction. The code first checks for the capability (if input) then checks for the role (if input).

To check for multiple capabilities or multiple roles, simply add a comma between each capability/role. For example, the following code checks for an editor or administrator:

[members_access role="administrator,editor"]Show this content to administrators or editors only.[/members_access]

To check that the user does not have a role:

[members_access role="administrator" operator="!"]Show this content to anyone who is not an administrator.[/members_access]

[members_logged_in]

The [members_logged_in] shortcode should be used to check if a user is currently logged into the site. If not, the content will be hidden.

[members_logged_in]This content is only shown to logged-in users.[/members_logged_in]

This shortcode has no parameters.

[members_not_logged_in]

The [members_not_logged_in] shortcode should be used to show content to users who are not logged into the site. If the user is logged in, the content will be hidden.

[members_not_logged_in]This content is only shown to logged-out visitors.[/members_not_logged_in]

[members_login_form]

The [members_login_form] shortcode is used to show a login form on the page.

[members_login_form /]

This shortcode has no parameters.

Widgets

The widgets component provides easy-to-use widgets for your site. They can be used in any WordPress widget area (provided by your theme). Currently, there's the Login Form and Users widgets.

Login Form widget

The Login Form gives you a login form. It's a mixture of a text widget and login form. It can also show your avatar.

Users widget

The Users widget allows you to list users in any widget area. It's based off the get_users() function, so all of the parameters are the same.

Private site

The Private Site features makes sure that only logged-in users can see anything on your site. If a user visits your site and is not logged in, they are immediately redirected to your wp-login.php (WordPress login) page.

You also have the option of disabling the viewing of feed content and setting an error message for feed items.

Checking if the current user has a capability

In plugins and your theme template files, you might sometimes need to check if the currently logged in user has permission to do something. We do this by using the WordPress function current_user_can(). The basic format looks like this:

<?php if ( current_user_can( 'capability_name' ) ) echo 'This user can do something'; ?>

For a more practical situation, let's say you created a new capability called read_pages. Well, you might want to hide the content within your page.php template by adding this:

<?php if ( current_user_can( 'read_pages ' ) ) : ?>
	<?php the_content(); ?>
<?php endif; ?>

Only users with a role that has the read_pages capability will be able to see the content.

Checking if a user has a role

Before beginning, I want to note that you really shouldn't do this. It's better to check against capabilities. However, for those times when you need to break the rules, you can do so like:

if ( members_user_has_role( $user_id, $role ) )

Or, you can check against the current user:

if ( members_current_user_has_role( $role ) )

Need the old user levels system?

Some plugins and themes might rely on the old user level system in WordPress. These were deprecated in WordPress version 2.1 and should not be used at all. WordPress still has minimal legacy support for these, but I highly suggest contacting your theme/plugin author if user levels are being used.

By default, the levels aren't shown. They still exist, but are tucked away behind the scenes. While not recommended, if you need to control who has what level (levels are just capabilities), add this to your plugin or your theme's functions.php:

add_filter( 'members_remove_old_levels', '__return_false' );

Registering capabilities

If you're a plugin developer with custom capabilities, beginning with version 2.0.0 of Members, you can register your capabilities with Members. Essentially, this allows users to see your capabilities in a nicely-formatted, human-readable form (e.g., Publish Posts instead of publish_posts). This also means that it can be translated so that it's easier to understand for users who do not read English.

add_action( 'members_register_caps', 'th_register_caps' );

function th_register_caps() {

	members_register_cap(
		'your_cap_name',
		array(
			'label' => __( 'Your Capability Label', 'example-textdomain' ),
			'group' => 'example'
		)
	);
}

The group argument is not required, but will allow you to assign the capability to a cap group.

Registering cap groups

Members groups capabilities so that users can more easily find them when editing roles. If your plugin has multiple capabilities, you should consider creating a custom cap group.

add_action( 'members_register_cap_groups', 'th_register_cap_groups' );

function th_register_cap_groups() {

	members_register_cap_group(
		'your_group_name',
		array(
			'label'    => __( 'Your Group Label', 'example-textdomain' ),
			'caps'     => array(),
			'icon'     => 'dashicons-admin-generic',
			'priority' => 10
		)
	);
}

The arguments for the array are:

  • label - An internationalized text label for your group.
  • caps - An array of initial capabilities to add to your group.
  • icon - The name of one of core WP's dashicons or a custom class (would need to be styled by your plugin in this case).
  • priority - The priority of your group compared to other groups. 10 is the default.

Note that custom post types are automatically registered as groups with Members. So, if you want to do something custom with that, you simply need to unregister the group before registering your own.

members_unregister_cap_group( "type-{$post_type}" );

members's People

Contributors

justintadlock avatar richardtape avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

members's Issues

Members breaks on install.php if a mu-plugin

From: http://wordpress.org/support/topic/members-breaks-on-installphp-if-a-mu-plugin

This is a somewhat obscure use-case but it appears that the Members plugin throws errors is it is deployed to a new site without an tables it tried to insert 'members_db_version' key into wp_options before wp_options exists.

Adding the following code at the top of /members/includes/update.php solves the problem:

if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING )
  return;

I can work around it by putting the code into my must-use plugin loader, but I thought you might want to know.

Reset default roles & capabilities

It would be awesome to have some way to reset the default roles and capabilities.

I haven't played too much with actually deleting a predefined role from wordpress (like removing the contributor role for example) but if someone were to do this (for any of the predefined roles) it would be really nice to be able to get that default role back. Again I haven't deleted a default role so I don't know if it's even possible (the plugin has a link that implies I can do it) or how that would affect everything, but it would definitely be good to have a reset option of some kind. Just thinking about it, I wouldn't imagine creating a new role with the right capabilities would not be exactly the same because the role ID wouldn't match and I don't know how important that is.

Something I have played with for sure is changing the capabilities of the default roles. In this case it would be great to be able to reset a role back to its defaults. Even better would be to also indicate which capabilities are default for that role when viewing the capability editor, as well as having an easy reset button. Of course custom roles wouldn't have default capabilities so they wouldn't need indicators about default capabilities, or a reset button (unless that button simply removed all capabilities, but that might be undesirable).

Thanks for reading!

Allow Editor to edit other user's Roles but not grant Administrator

I have a user role: "Editor". I gave them the capability of: "promote_users" so that they could add certain roles to other lower users who do not have this capability. But how do i prevent these editor's from promoting themselves to a higher role like "administrator" because right now they can choose any roles they want for anybody.

Add filter to members_content_permissions_meta_box function for customizing roles

I have a client who is easily confused and I'd like the content control metabox that appears on each post to only display certain roles to chose from.

In the members_content_permissions_meta_box() function you display a checkbox for every role in the global $wp_roles. Would it be possible to add a filter just before the foreach so that I can customize which roles are displayed in the metabox?

Like so:

/* Loop through each of the available roles. */
$roles = apply_filters( 'members_content_permissions_meta_box_roles', $wp_roles->role_names );

foreach ( $roles as $role => $name )

Admin capabilities missing/can't save

I'm using Members on a multisite instance, and I've added a few types of custom capabilities for CPTs. Somehow, the 'read' permission and a few others have been disabled for Administrators, resulting in them not having permissions to view wp-admin at all.

I can enable them and save, but when I go back into the Admin role, they are disabled again.

I've tried disabling the plugin, but it seems to persist in the DB- people with Administrator capabilities still can't log in.

Remove filter

I'm trying to remove some filters applied by the plugin, but it's not working.

remove_filter( 'get_the_excerpt', 'members_content_permissions_protect');

Any help?

members_can_user_view_post returns notice on custom endpoint

When reaching a custom endpoint with a rewriting api, we have a notice in members_can_user_view_post function :

<b>Notice</b>:  Trying to get property of non-object in <b>.../wp-content/plugins/members/inc/template.php</b> on line <b>97</b>

When creating a custom endpoint, we are not in a wp loop, so the function get_the_ID return false and the line get_post( $post_id )->post_parent return a notice

Thank you for your help

Expose user levels

When I first created this plugin, user levels had already been deprecated for a long time in core. There was one exception with the author drop-down, which I was told would be fixed by now. But, it's still lingering around:
http://core.trac.wordpress.org/ticket/16841

Members originally hid user levels from the edit role screen so that users could report issues with plugins that were still using them. I haven't gotten a report on this in a long while and have been able to help several plugin authors in the past. Good job by plugin authors!

But, WordPress is still the problem. Basically, when you create new user roles, they need to be assigned a level to appear in the author drop-down on the edit post screen. For most users, this hasn't been an issue. I still get the occasional support question on this though.

Therefore, I'm probably going to add a checkbox (on the settings page) to show user levels on the edit role screen (disabled by default).

members_get_role_capabilities() does not return custom post type capabilities

I have a custom post type defined as follows:

  // Videos 
  $labels = array(
    'name'               => _x( 'Videos', 'post type general name' ),
    'singular_name'      => _x( 'Video', 'post type singular name' ),
    'add_new'            => _x( 'Add New', 'book' ),
    'add_new_item'       => __( 'Add New Video' ),
    'edit_item'          => __( 'Edit Video' ),
    'new_item'           => __( 'New Video' ),
    'all_items'          => __( 'All Videos' ),
    'view_item'          => __( 'View Video' ),
    'search_items'       => __( 'Search Videos' ),
    'not_found'          => __( 'No Videos found' ),
    'not_found_in_trash' => __( 'No Videos found in the Trash' ), 
    'parent_item_colon'  => '',
    'menu_name'          => 'Videos'
  );
  $args = array(
    'labels'        => $labels,
    'description'   => 'Holds our Videos specific data',
    'public'        => true,
    'taxonomies' => array('category', 'post_tag'),
    'menu_position' => 3,
    'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments', 'author'),
    'has_archive'   => true,
    'map_meta_cap' => true,
        'capability_type' => 'video',
        'capabilities' => array(
            'publish_posts' => 'publish_videos',
            'edit_posts' => 'edit_videos',
            'edit_others_posts' => 'edit_others_videos',
            'delete_posts' => 'delete_videos',
            'delete_others_posts' => 'delete_others_videos',
            'read_private_posts' => 'read_private_videos',
            'edit_post' => 'edit_video',
            'delete_post' => 'delete_video',
            'read_post' => 'read_video',
        ),  
  );
  register_post_type( 'video', $args ); 

With the following map_meta_cap filter code

    add_filter( 'map_meta_cap', 'my_map_meta_cap', 10, 4 );
    function my_map_meta_cap( $caps, $cap, $user_id, $args ) {

        /* If editing, deleting, or reading a movie, get the post and post type object. */
        if ( 'edit_video' == $cap || 'delete_video' == $cap || 'read_video' == $cap ) {
            $post = get_post( $args[0] );
            $post_type = get_post_type_object( $post->post_type );

            /* Set an empty array for the caps. */
            $caps = array();
        }

        /* If editing a movie, assign the required capability. */
        if ( 'edit_video' == $cap ) {
            if ( $user_id == $post->post_author )
                $caps[] = $post_type->cap->edit_posts;
            else
                $caps[] = $post_type->cap->edit_others_posts;
        }

        /* If deleting a movie, assign the required capability. */
        elseif ( 'delete_video' == $cap ) {
            if ( $user_id == $post->post_author )
                $caps[] = $post_type->cap->delete_posts;
            else
                $caps[] = $post_type->cap->delete_others_posts;
        }

        /* If reading a private movie, assign the required capability. */
        elseif ( 'read_video' == $cap ) {

            if ( 'private' != $post->post_status )
                $caps[] = 'read';
            elseif ( $user_id == $post->post_author )
                $caps[] = 'read';
            else
                $caps[] = $post_type->cap->read_private_posts;
        }

        /* Return the capabilities required by the user. */
        return $caps;
    }  

When i visit /wp-admin/users.php?page=roles&action=edit&role=administrator
I can see the capabilities tab for Video. If i click on it, and set any of the capabilities to grant, then save. I can see that the data is being posted, e.g. grant-caps[]:edit_videos
But in class-role-edit the foreach loop loops through members_get_capabilities(). This function does not return any of the video capabilities. So when saving, the grant settings are omitted and not saved for these capabilities.

Any idea why? or how to fix this?

PHP Notice: has_cap called with depreciated argument

I have wp_debug on and am getting the following PHP Notice:

Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead

Wondering if this is due to the new roles not being recognized and the system just assumes members_get_capabilities() is returning depreciated user_levels?

Select all/none in capabilities editor

Can you add a select all/none checkbox in the capabilities editor for both grant and deny columns? Just kind of a nice touch.

Since you have the capabilities split into sections like general, posts, pages, etc, it would be great to go to one of those sections and select all for just that section and move on to another section. Of course viewing the "all" section and having a select all/none checkbox would be nice too.

Role clone

I realize you're actively working on the dev branch (like a couple hours ago actively). But just in case you weren't aware, I just noticed I no longer see an option to clone.

Members_Load Constructor PHP Warning

Hi. I've found this being logged on a vanilla WP 3.6.1:

PHP Strict Standards: Redefining already defined constructor for class Members_Load in ...public_html/wp-content/plugins/members/members.php on line 50

Shortcode not working

Not sure why, content in shortcode [members_access role=""] just don't show up. Not sure if that's related to members_user_has_role() require the user ID as well? I made some changes locally on functions-shortcodes.php:128

Clone role

Quick link under the role name on the roles list table to clone a role. This link should copy the caps for whatever role is selected and take the user to the add new role page. From there, they can save or customize then save.

Role hierarchy (sort of)

Users keep asking for it. I keep explaining that roles aren't hierarchical. But, there is some use for it, particularly when a user has the ability to assign roles to users.

So, we should filter editable_roles and run some checks based on the site admin's setup of a hierarchy. This should either be a part of this plugin or as a companion plugin.

PHP 5.4.6 error

Hey Justin: I'm running the latest version of your plugin on a dev server with PHP 5.4.6 and it's kicking out the error: Creating default object from empty value in line 21 of includes/functions.php

It can be fixed by adding the last line below:

function members_get_setting( $option = '' ) {
    global $members;
    $members =& new stdclass;

Support content permission per category

Currently the plugin allows us to select if a post is visible or not.

But to make it easier for users it would be awesome to be able to set apply content permissions to a full category.

So all posts in categoryX would only be visiable to logged-in users, or a role.

Failure(s?) with Wordpress 4.0

I upgraded to WP 4 a few weeks ago and I see too late that members is only tested through 3.7.1. My users can't edit pages and the role indicates they can so now I'm stuck. Any chance this will be upgraded soon. I will probably break my site if I try to revert to WP 3.7.1

WordPress database error: [MySQL server has gone away]

Hi Justin, great work on members! I use it in almost every site I build!

But this time I'm facing an odd problem.

When I go to the page for creating new role i see that message (in the thread title) followed by a pretty huge mysql dump starting with

INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_pods_get_all',

followed by what seems to be serialized data 'a:5:{i:51;a:35:{s:11:"object_type";s:3:"pod";s:4:"type" etc... closed by these statements:

 ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)

Looks like transients from pods framework are involved. The error is shown only on the pages of your plugin.

It's nothing deadly. All the operations are working well. It's just annoying to have a page several thousands of pixel high and wide to scroll around :)

Display capabilities with human readable descriptions

Would it be possible to display human readable descriptions for the capabilities in the roles/capabilities editor when editing a role? Personally I would still like to see the capability's actual name, but a brief description next to the name would certainly be handy!

Network-wide roles

I haven't looked into the feasibility of this, but here's the scenario I imagine:

  • Go to Add New Role Page.
  • Add a checkbox at the bottom (shown only if is_super_admin() and is_multisite()).
  • The checkbox would be something like "Create this role across the entire network?"

I'd have to look more into it. I'm fairly certain it's possible to create the role across all existing sites in the network. I'm not sure if it's easy to have those roles for new sites after the role has been created.

I'm not that familiar with multisite, but I do know that roles are saved on a per-site basis. If anyone wants to help out with this, please do.

Hide restricted content from menus

I have noticed that using this plugin when I use the content restriction options to limit certain pages for example to only be seen by admin and editor, all users regardless of role can still see the link to that page in the navigation menu (using built in WP menu editor for my menus in my themes). There is another plugin similar to this one that allows those links for restricted pages to be hidden, but this plugin has more benefits so i'd prefer to fully switch to just this plugin. Could it be possible for this plugin to hide links from navigation menus when the person viewing is not assigned to a role capable of viewing said item?

(I am copying this from my wordpress.org support forum post https://wordpress.org/support/topic/hide-restricted-content-from-menus to github as an issue, it seems to make more sense here)

Using roles in CSS styling of pages

Hi Justin

Thank you for a super and free plugin. Much appreciated.

I was just trying to see if the plugin adds any CSS to posts. One thing I am looking to do is style pages so a user knows they are in a restricted area. That is, they know they can see it and others cannot.

I don't see it in the plugin, but thought I would check in.

Once again, many thanks.

Regards
Mike

[BUG] Capability counter is wrong - showing more

Viewing the "Roles" screen under the "Users" menu...

By default, the "Contributor" Role is supposed to have THREE capabilities, yet this plugin is showing "5" in the "capabilities" column. When I click "edit" I only see the three defaults.

By default, the "Subscriber" Role is supposed to have ONE capability, yet this plugin is showing "2" in the "capabilities" column. When I click "edit" I only see one (default: read).

The WooCommerce "Customer" Role is supposed to have the same capabilities as "Subscriber" Role, which is ONE... but "3" is shown in the "capabilities" column. Then when I click on "edit" I only see one capability (default: read). I edited it to add two more capabilities and went back to the Roles screen where it still shows "3" capabilities although I just added two! I added two, so why doesn't it show five and what happened to the two that were apparently hidden?

This is scary stuff... are there hidden capabilities and did this plugin just delete them? What's really happening here?

Thank-you.

feature: error messages for shortcodes

error message is displayed only based on status or role. if not logged in or if not editor you'll see the error message. You don't see it if you're logged in or editor and above.

Styling via css would be appreciated as well as custom wording based on the single shortcut.

Enhancement - Shortcode Display Member Error Instead of Blank/Nothing

Hi Justin,

Question / Enhancement - Do you think it would be worth displaying non members an error or message when viewing content hidden by one of the members shortcodes?

So for example if I use [is_user_logged_in] to wrap (and hide) some member only content - instead of just displaying nothing it might be nice to show one of the member error messages. Like so -> findingsimple@ef8b295

Perhaps for a nicer implementation the output could just be wrapped with a filter so that it can be hooked into within a theme or another plugin?

Bulk and/or quick edit content permissions

This is a feature requested by users every so often.

I've never even played around with bulk editing before, so I'll have to dig into this. The first step should probably be testing out quick editing. At least try to roll out quick editing in v.0.3.0.

If anyone's looking into this, keep in mind that content permissions (the roles checked) are saved as multiple meta values on a single meta key.

Private Site

Using the Redirect all logged-out users to the login page before allowing them to view the site option.
But would like them to register as well, but it seems it blocks the sign up page as well.
So no new users can register only Login.
Any Help would be appreciated.
Thanks

Support for per-user capabilities

Hi @justintadlock

I was wondering if as an enhancement, you could implement per-user capabilities? This would allow groups of users to access certain posts, but also for these groups to be flexible (some users from a group could access several kinds of posts, for example). This isn't possible using Roles without creating one for each user.

The PHP for achieving per-user roles is:

$user = new WP_User( $user_id );
$user->add_cap( $capability );

All the best and thanks for the fantastic plugin,

Robert

Group capabilities by type

Currently capabilities are listed by permission level (all read, then all edit, etc.). It would be nice to have them grouped by type, so all the 'post' permissions are grouped together, 'page' permissions are grouped together, and if there is a custom post type, all those permissions would be grouped together.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.