Git Product home page Git Product logo

groups's Introduction

=== Groups ===
Contributors: itthinx, proaktion
Donate link: https://www.itthinx.com/shop/
Tags: groups, access, access control, membership, memberships, member, members, capability, capabilities, content, download, downloads, file, file access, files, paypal, permission, permissions, subscription, subscriptions, woocommerce
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
Stable tag: 2.20.1
License: GPLv3

Groups is an efficient and powerful solution, providing group-based user membership management, group-based capabilities and content access control.

== Description ==

Groups is designed as an efficient, powerful and flexible solution for group-oriented memberships and content access control.

It provides group-based user membership management, group-based capabilities and access control for content, built on solid principles.

Groups is light-weight and offers an easy user interface, while it acts as a framework and integrates standard WordPress capabilities and application-specific capabilities along with an extensive API.

Enhanced functionality is available via [Official Extensions](https://www.itthinx.com/product-category/groups/) for Groups.

### Documentation ###

The official documentation is located at the [Groups Documentation](https://docs.itthinx.com/document/groups/) pages.

### Features ###

#### User groups ####

- Supports an unlimited number of groups
- Provides a Registered group which is automatically maintained
- Users can be assigned to any group
- Users are added automatically to the Registered group

#### Groups hierarchy ####

- Supports group hierarchies with capability inheritance

#### Group capabilities ####

- Integrates standard WordPress capabilities which can be assigned to groups and users
- Supports custom capabilities: allows to define new capabilities for usage in plugins and web applications
- Users inherit capabilities of the groups they belong to
- Groups inherit capabilities of their parent groups

#### Access control ####

Access to posts, pages and custom post types can be restricted by group.

If access to a post is restricted to one or more groups, only users who belong to one of those groups may view the post.

Fully supports custom post types, so that access to post types such as products or events can easily be restricted.

- Built-in access control that allows to restrict access to posts, pages and custom content types to specific groups and users only
- Control access to content by groups: shortcodes allow to control who can access content on posts, show parts to members of certain groups or to those who are not members -
  Shortcodes: [groups_member], [groups_non_member]
- Control access to content by capabilities: show (or do not show) content to users who have certain capabilities -
  Shortcodes: [groups_can], [groups_can_not]
- Blocks: The Groups Member block allows to restrict the visibility of its content to members of selected groups.
  The Groups Non-Member block hides its content from members of chosen groups.
  The blocks can be nested to provide multiple layers of access control to content.

#### Easy user interface ####

- Integrates nicely with the standard WordPress Users menu
- Provides an intuitive Groups menu
- Conceptually clean views showing the essentials
- Quick filters
- Bulk-actions where needed, for example apply capabilities to groups, bulk-add users to groups, bulk-remove users from groups

#### Sensible options ####

- Enable access restrictions by custom post type
- An optional tree view for groups can be shown when desired
- Provides its own set of permissions
- Administrator overrides for tests
- Cleans up after testing with a "delete all plugin data" option

#### Framework ####

- Groups is designed based on a solid and sound data-model with a complete API that allows developers to create group-oriented web applications and plugins

#### Multisite ####

- All features are supported independently for each blog in multisite installations

### Extensions ###

Enhanced functionality is available via official [Extensions](https://www.itthinx.com/shop/) for Groups.

Groups is a large project that is providing essential functionality to tens of thousands of sites since 2012. By getting an official extension, you help fund the work that is necessary to maintain and improve Groups.

- [Groups WooCommerce](https://www.itthinx.com/shop/groups-woocommerce/) : Sell Memberships with Groups and WooCommerce – the best Group Membership and Access Control solution for WordPress and WooCommerce.
- [WooCommerce Group Coupons](https://www.itthinx.com/shop/woocommerce-group-coupons/) : Automatically apply and restrict coupon validity for user groups. Offer exclusive, automatic and targeted discounts for your customers.
- [Groups Drip Content](https://www.itthinx.com/shop/groups-drip-content/) : Release content on a schedule. Content dripping can be based on user account creation, group memberships and specific dates and times.
- [Groups File Access](https://www.itthinx.com/shop/groups-file-access/) : Allows to provide file download links for authorized users. Access to files is restricted to users by their group membership.
- [Groups Restrict Categories](https://www.itthinx.com/shop/groups-restrict-categories/) : Features access restrictions for categories, tags and other WordPress taxonomies, including support for custom post types and taxonomies.
- [Groups Forums](https://www.itthinx.com/shop/groups-forums/) : A powerful and yet light-weight forum system for WordPress sites.
- [Groups Import Export](https://www.itthinx.com/shop/groups-import-export/) : Provides import and export facilities around users and groups.
- [Groups Newsletters](https://www.itthinx.com/shop/groups-newsletters/) : Newsletter Campaigns for Subscribers and Groups.
- [Widgets Control Pro](https://www.itthinx.com/shop/widgets-control-pro/) : An advanced Widget toolbox that adds visibility management and helps to control where widgets are shown efficiently.

### Feedback ###

Feedback is welcome!

If you need help, have problems, want to leave feedback or want to provide constructive criticism, please do so here at the [Groups Plugin](https://www.itthinx.com/plugins/groups/) page.

Please try to solve problems there before you rate this plugin or say it doesn't work. There goes a _lot_ of work into providing you with free quality plugins! Please appreciate that and help with your feedback. Many thanks!

#### Stay informed or contribute ####

Follow @itthinx on [Twitter](https://twitter.com/itthinx) and [GETTR](https://gettr.com/user/itthinx) for news related to Groups and other plugins.

Get development notifications, contribute code or open issues at the repository on [GitHub](https://github.com/itthinx/groups).

### Translations ###

Brazilian Portuguese translation by [Walter Jaworski](http://wjaworski.com),
Dutch translation by [Carsten Alsemgeest](http://presis.nl),
French translation by [Stéphane Passedouet](http://www.pheeric.com),
German translation by [itthinx](https://www.itthinx.com),
Lithuanian translation by [Vincent G](http://www.Host1Free.com),
Spanish translation by [Juan Amor](http://www.lamadjinpa.es),
Swedish translation by [Andréas Lundgren](http://adevade.com).

Many thanks for your help!

== Installation ==

1. Upload or extract the `groups` folder to your site's `/wp-content/plugins/` directory. You can also use the *Add new* option found in the *Plugins* menu in WordPress.  
2. Enable the plugin from the *Plugins* menu in WordPress.

== Frequently Asked Questions ==

= Where is the documentation? =

The official documentation is located at the [Groups Documentation](https://docs.itthinx.com/document/groups/) pages.

= I have a question, where do I ask? =

For questions directly related to Groups, you can leave a comment at the [Groups Plugin](https://www.itthinx.com/plugins/groups/) page.

= How do I restrict access to a post? =

Let's assume you want members of the *Premium* group to be able to view some restricted posts.

- If you want to create a new protected post, simply go to *Posts > Add New* as usual and in the _Groups_ box input *Premium* in the _Read_ field. Save or publish your post.
- If you want to protect an existing post you can simply edit it, input *Premium* in the _Read_ field of the _Groups_ box and update the post.

In both cases, it doesn't matter if the *Premium* group already exists or not, if it doesn't, it will be created automatically.

If the *Premium* group already exists and you want to protect one or more existing posts in bulk, go to *Posts*, select all posts you want to protect and choose *Edit* in the *Bulk Actions* dropdown.
Now click *Apply*, select the *Premium* group and click *Update*.

After you publish or update your posts, only members of the *Premium* group will be able to see them.

= I want Advanced and Premium members, where the Premium members can access everything that Advanced members can access. How can I do that? =

Example: Advanced and Premium members

1. Go to *Groups > Groups > New Group* and add two new  groups, let's call them *Advanced* and *Premium* - select *Advanced* as the *Parent* for the *Premium* group.
2. Now create an example post that only members of the *Advanced* group should be able to access and choose the *Advanced* group in the _Read_ field of the _Groups_ box.
3. Create another post for members of the *Premium* group and choose the *Premium* group for that post.
4. Assign test users to both groups, log in as each user in turn and see which posts will be accessible.

= How do I limit access to posts so that users in group A can not read the same as those in group B and vice-versa? =

Example: Green and Red members

1. Go to *Groups > Groups > New Group* and add two new groups, let's call them *Green Members* and *Red Members*
2. Now create an example post that only members of the *Green Members* group should be able to see and choose the *Green Members* group in the _Groups_ box.
3. Create another post for *Red Members* and choose the *Red Members* group for that post.
4. Assign a test user to each of the groups, log in as one of them and you will see that the member of the *Green Members* group will only have access to the post protected by that group but not to the post protected with the *Red Members* group and vice-versa.

= Are access restrictions for Custom Post Types (CPT) supported? =

Yes. Access restrictions can be turned on or off for specific CPTs on the *Groups > Options* page.

= How can I show groups that users belong to on their profile page in the admin section? =

Go to *Groups > Options* and enable the option under *User profiles*.

= Developers ... aka ... What about Groups' API? =

The Groups plugin provides an extensive framework to handle memberships, group-based capabilities and access control.

The API documentation page is available at [API](https://docs.itthinx.com/document/groups/api/).

Also refer to the official [Groups Plugin](https://www.itthinx.com/plugins/groups/) page to post your questions and the [Documentation](https://docs.itthinx.com/document/groups/) pages for Groups.

== Screenshots ==

See also the [Groups Documentation](https://docs.itthinx.com/document/groups/) pages and the [Groups Plugin](https://www.itthinx.com/plugin/groups/) page.

1. Groups - this is where you add and remove groups and assign capabilities to groups.
2. Capabilities - here you get an overview of the capabilities that are defined and you can add and remove capabilities as well.
3. Users - group membership is managed from the standard Users admin view.
4. Filter the list of users by one or more groups.
5. Add users to groups or remove them in bulk.
6. Groups a users belongs to shown in the user profile.
7. Filter posts by groups.
8. Add or remove access restrictions based on groups in bulk.
9. Restrict access on pages and posts (and other custom post types) ... you can restrict access to users who are members of one or more groups.
10. A post restricted to members of a *Premium* group only.
11. Usage of the [groups_member] and [groups_non_member] shortcodes to limit visibility of content to users who are members of a group or users who are not members of a group. Multiple comma-separated groups can be specified.
12. Usage of the [groups_can] and [groups_can_not] shortcodes. Limits visibility of enclosed content to those users who have the capability or those who do not. Multiple capabilities can be given.
13. Options - you can adjust the plugin's settings here.
14. More options.

== Changelog ==

For the full changelog see [changelog.txt](https://github.com/itthinx/groups/blob/master/changelog.txt).

== Upgrade Notice ==

This release has been tested with the latest version of WordPress.

groups's People

Contributors

ablancodev avatar adevade avatar billerr avatar charlesmulder avatar christianwach avatar deanmarktaylor avatar dslavcheva avatar elievischel avatar ericmuigai avatar ericmulder avatar geotsiokos avatar haroldkyle avatar itthinx avatar jmalko avatar joryhogeveen avatar mattyza avatar somethumb avatar tricki 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

groups's Issues

Post count in category widget showing all posts regardless of access

How to reproduce:

  1. Create numerous posts and restrict them to a group.
  2. Assign a user to a group that has access to say just 1 post (or none) from the few you created.
  3. Add the core Categories widget to the sidebar (check: show post counts)
  4. Widget will show empty categories (hide_empty is on by default), and clicking on them shows a 404 not found (because the user doesn't have access to any posts in that category, but WordPress still considers it not empty and keeps showing it in the list).

Expected Result

A category should be considered empty if a user has access to 0 posts in that category and WordPress would no longer display it in the widget.

Deprecated constructors

Getting this warning when using Groups in WP:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Groups_Pagination has a deprecated constructor in .../plugins/groups/lib/core/class-groups-pagination.php on line 29

Issue with jQuery selectize enqueue and embedded tinyMCE editor

Hello,

The Problem

When we have the classic WP Editor (or the tinyMCE editor) embedded elsewhere (like elementor page builder or any custom plugin page), then the following script is executed

if (document.readyState === "complete" || document.readyState === "interactive") {
    if (typeof jQuery !== "undefined") {
        jQuery("#attachments-39-groups-read").selectize({
            create: true,
            plugins: ["remove_button"]
        });
    }
} else {
    document.addEventListener("DOMContentLoaded", function() {
        if (typeof jQuery !== "undefined") {
            jQuery("#attachments-39-groups-read").selectize({
                create: true,
                plugins: ["remove_button"]
            });
        }
    });
}

directly in the page. From a quick search I see that the script is added to a bunch of pages like https://github.com/itthinx/groups/search?q=render_select&unscoped_q=render_select but I don't see that the needed selectize plugin is actually being enqueued to all of the pages.

This results in the error Uncaught TypeError: jQuery(...).selectize is not a function.

The quick solution

I believe this would prove to be a quick solution

if (document.readyState === "complete" || document.readyState === "interactive") {
-    if (typeof jQuery !== "undefined") {
+    if (typeof jQuery !== "undefined" && typeof jQuery.fn.selectize === "function") {
        jQuery("#attachments-39-groups-read").selectize({
            create: true,
            plugins: ["remove_button"]
        });
    }
} else {
    document.addEventListener("DOMContentLoaded", function() {
-        if (typeof jQuery !== "undefined") {
+        if (typeof jQuery !== "undefined" && typeof jQuery.fn.selectize === "function") {
            jQuery("#attachments-39-groups-read").selectize({
                create: true,
                plugins: ["remove_button"]
            });
        }
    });
}

The long term solution

This would be to identify why the above script is rendered on any page where tinyMCE is loaded. I don't know about elementor, but on my plugin I am using wp_editor to load the tinyMCE embedded editor for custom work. Looks like Groups plugin is hooking somewhere and injecting the inline JS, but not really enqueuing the dependencies. I don't know the inner workings of the plugin, but I can sure help you out to find the issue if you direct me where to look.

Group meta and pull requests

Hi,

I’m looking to use Groups in my website and have two questions. I like the fact that the data is stored in a straight forward way, compared to other group plugins and that it doesn’t have much overload in code.

  1. I see some excellent pull request with additional filters and more. Are they being considered for merging?
  2. What would be the best way to add meta-data to a group, without loosing compatibility with the plugin? Ideal there would be a database table for that I think. Is that something that’s part of current development or, if I was to create it myself, something that would be considered for merging?

Thanks!

Dashboard selecting wrong plugin localization

Hi,

I have default site language set German, but in Administrator user profile I set to English as my working language. I am using Polylang and WPML plugins ( in separate environments)

For any other plugin I am using , dashboard showing them properly in English.

Groups plugin menus are not.

help!!! your plugin crashes an entire WP site

and disabling it exposes very sensitve data to the public and search engines...

this is a disaster. please help. let me know what I can do to help you to help me.

Groups version: 2.16.1
WordPress 5.9

Plugin won't activate with lots of users

We have about 12,000 users on our blog, so the plugin hangs for a long time upon activation. Eventually memory is exhausted as the activation cycles through Groups_User_Group::create() within Groups_Registered::activate(). The only way I could successfully activate the plugin was by commenting out the foreach over all users. I followed this up with an SQL query to make sure all the blog's users were added to the Registered group:

insert ignore into wp_3_groups_user_group 
select ID, 1 from wp_users u
join wp_usermeta um on um.user_id = u.ID and um.meta_key = 'wp_3_capabilities';

Perhaps (if this indeed is what the plugin does here) you could take a similar approach, which in my case only took 0.15 seconds.

Automatically remove a group upon user activation

I have a Gravity membership registration form that assigns a "Pending" group upon submission.

As of now, the admin manually removes the "Pending" group once they activate the member, but I am wondering if it is possible to automatically remove that "Pending" group from the user once the admin activates their account?

wp_cache_reset issue

Whenever I am trying to delete/switch a blog, I am getting this error in my apache log:

PHP Fatal error: Uncaught Error: Call to undefined function wp_cache_reset() in /wp-content/plugins/groups/lib/core/class-groups-controller.php:46\nStack trace:\n#0 /wp-content/plugins/groups/lib/core/class-groups-controller.php(98): Groups_Controller::switch_to_blog(12)\n#1 /wp/wp-includes/plugin.php(524): Groups_Controller::delete_blog(12, true)\n#2 /wp/wp-admin/includes/ms.php(78): do_action('delete_blog', 12, true)\n#3 /wp/wp-admin/network/sites.php(133): wpmu_delete_blog(12, true)\n#4 {main}\n thrown in /wp-content/plugins/groups/lib/core/class-groups-controller.php on line 46

My wordpress version is 4.6 .

Thanks.

Ability to disable groups on frontend

Hi,
is there an option to disable this plugin on the frontend?
I need it only in the backend, because everyone should see the website,
but only specific users should edit(administer) certain parts of website. I made a workaround
that seems to work by modifiying file lib/access/class-groups-post-access.php
on few places, but is there an option to do this somewhere in plugin config?

List all Groups

I have noticed i can display all groups for a user, but i would like to list all groups themselves.

How would i go about it?

Important change in 2.2.0

In the 2.2.0 change log:

Important change in this version: If access restrictions for post type are disabled, related entries will not be protected anymore.

What does this mean? This sounds like a breaking change that could have a negative impact on my site. Is there detailed documentation of the impact of this change somewhere?

A similar change came along a while back that opened up access to all of my protected content to the whole world, which caused confusion with my users and exposed my protected content to the world. For somebody making a living from their site, that's a disaster.

Changes like that should be communicated in the strongest possible terms, with advance notice, and detailed instructions for changes to make in order to make a smooth transition possible.

Also, please look at semver and breaking changes.

I suspect that most people using this plugin rely on it for income. Breaking changes are a big deal and need to be treated as such.

Plugin will not activate

"Plugin could not be activated because it triggered a fatal error."

For the version just downloaded from the .zip.

Bypass group control by server access

Hi.
First at all thanks for this pugin, so useful!

On my WP, user can download the page in pdf format using the WKHTMLTOPDF lib.
The site is only accessible for registered user and some page need specific right managed with groups.

This work well.
However i have trouble when i generateing a pdf from a page protect by the groups plugin (and this is normal)

Here is my code

function template_redirect() {
    global $post;

    if( ( $_SERVER['REMOTE_ADDR'] == $_SERVER['SERVER_ADDR'] ) && isset($_GET['wkhtmltopdf']) ) return;

}
add_action( 'template_redirect',  'template_redirect'  );

How i can tell to group that if the page is asked by the server itself, it can remove his control ?

thanks

Groups WooCommerce - Users don't get added to groups on checkout.

Description

I am selling memberships, and users are not getting added to the members group on checkout.

Steps to Reproduce

Install and enable WooCommerce, Groups, & Groups WooCommerce. Configure a product to add users to a group called members. Check out.

Expected

User should be added to the "members" group.

Actual

Customers do not get added to "members" group. That makes customers sad. 😢

screen shot 2015-07-19 at 6 34 45 pm

Groups_Post_Access: filtering not applied on WooCommerce archive pages

Hi!

I discovered recently on a website that I maintain that the Groups_Post_Access::posts_where method doesn't apply the proper filtering in product archive pages. The reason was that all tests for the $filter boolean currently only check the 'post_type' query var. However, it seems that WooCommerce never sets 'post_type' => 'product' for the archive page wp_query, but instead sets 'wc_query' => 'product_query' (I don't know if this is a recent change in WC or if it's particular to our website environment)

In any case, I added this specific check in the Groups_Post_Access class in pull request #81

REST API

Hello!

is it possible to CRUD the Groups via Rest API? I couldnt find anything online.

Thanks!

Questioning The Value Of The Where Pattern

I've been using this plugin for a client and have been looking at using one of the groups as a means to exclude posts.

This is not covered by the core functionality and so I have been investigating how to create it myself.

In doing so, I happened to find the code you've used to edit the "where" part of the query.

I am unsure as to why this exists in the form it does?

After looking through your code, and the subsequent entries in the database, why don't you just hook into the pre_get_posts action and change the query to pull in certain meta_query values? To give an example: -

add_action('pre_get_posts', function($query) {
	
	$group = user_is_trade() ? 9 : 10;
		
	$query->set('meta_query', array(
		'relation' => 'OR',
		array(
			'key'     => 'groups-read',
			'value'   => $group,
			'compare' => 'IN'
		),
		array(
			'key'     => 'groups-read',
			'compare' => 'NOT EXISTS'
		)
	));
	
});

That's the code I have used to override your where query. It uses a meta_query to check for posts which a) don't have any "groups-read" meta keys (IE they have no group restrictions) and if they do have a key, then its value must be one of the ones stipulated in the code. Obviously, you'd embellish this with the various group ID's in your code etc.

My point is this is not only more succinct, but in line with the Wordpress hooks system. Rather than manually editing the query, you are able to leverage the extensive Wordpress backend to get the result you want.

I'm interested to know why this approach was not taken?

Thanks

2.20 - Adds Widget Category Label (hierarchy?) when unwanted

With no other edits/updates/content changes happening to the site in question, other than updating this plugin we are seeing some issues with the default Category Widget. Running 2.18 and even updating to 2.19 we see the following:
pre-2 20

After 2.20+:
post-2 20

Groups_User_Group::read ERROR

for some reason I cant get read function to work:

Groups_User_Group::read( $user->ID, $group->group_id );

as a result page brakes down with standard "The site is experiencing technical difficulties."

any idea if its a bug or what?

PHP Error in 2.16.0

Hi Team

Latest build has an error in /wp-content/plugins/groups/lib/admin/class-groups-admin.php

Line 250 has an extra , at the end of it that is causing the Admin area to error.

That extra comma needs to be removed.

Groups allows bypass of DISALLOW_FILE_EDIT & DISALLOW_FILE_MODS constants

Hello,

I've set the following in my wp-config.php:

define( 'DISALLOW_FILE_EDIT', TRUE );
define( 'DISALLOW_FILE_MODS', TRUE );

These are being overridden by the Groups plugin. It's in place for security reasons.

When groups plugin is activated: Plugin/Theme Editing, Plugin installation/deletion/update display are allowed
When groups plugin is deactivated: The above is unavailable.

Automatically assign a role to a a group in woocommerce

Hello,
I've seen that this question has been asked already, but I need more information.
I would like to automatically a specific role to a specific group.
Can you help me ? I've tried different shortcodes like
[groups_join role="GSS"]
but none of them worked.

Thank you for advance

logic is wrong with this code in class-groups-post-access.php

If you look at this function you get a cached and set it to $results but you test for $found

/**
 * Returns true if the user has any of the capabilities that grant access to the post.
 * 
 * @param int $post_id post id
 * @param int $user_id user id or null for current user 
 * @return boolean true if user can read the post
 */
public static function user_can_read_post( $post_id, $user_id = null ) {
    $result = false;
    if ( !empty( $post_id ) ) {
        if ( $user_id === null ) {
            $user_id = get_current_user_id();
        }
        $found = false;
        $result = wp_cache_get( self::CAN_READ_POST . '_' . $user_id . '_' . $post_id, self::CACHE_GROUP, false, $found );
        if ( $found === false ) {
            $groups_user = new Groups_User( $user_id );
            $read_caps = self::get_read_post_capabilities( $post_id );
            if ( !empty( $read_caps ) ) {
                foreach( $read_caps as $read_cap ) {
                    if ( $groups_user->can( $read_cap ) ) {
                        $result = true;
                        break;
                    }
                }
            } else {
                $result = true;
            }
            $result = apply_filters( 'groups_post_access_user_can_read_post', $result, $post_id, $user_id );
            wp_cache_set( self::CAN_READ_POST . '_' . $user_id . '_' . $post_id, $result, self::CACHE_GROUP );
        }
    }
    return $result;
}

corrected code

     /**
 * Returns true if the user has any of the capabilities that grant access to the post.
 * 
 * @param int $post_id post id
 * @param int $user_id user id or null for current user 
 * @return boolean true if user can read the post
 */
public static function user_can_read_post( $post_id, $user_id = null ) {
    $result = false;
    if ( !empty( $post_id ) ) {
        if ( $user_id === null ) {
            $user_id = get_current_user_id();
        }
        $found = false;
        $result = wp_cache_get( self::CAN_READ_POST . '_' . $user_id . '_' . $post_id, self::CACHE_GROUP, false, $found );
        if ( false === $result ) {
            $groups_user = new Groups_User( $user_id );
            $read_caps = self::get_read_post_capabilities( $post_id );
            if ( ! empty( $read_caps ) ) {
                foreach( $read_caps as $read_cap ) {
                    if ( $groups_user->can( $read_cap ) ) {
                        $result = true;
                        break;
                    }
                }
            } else {
                $result = true;
            }
            $result = apply_filters( 'groups_post_access_user_can_read_post', $result, $post_id, $user_id );
            wp_cache_set( self::CAN_READ_POST . '_' . $user_id . '_' . $post_id, $result, self::CACHE_GROUP );
        }
    }
    return $result;
}

I may open a pull request for this

SQL errors multisite

WordPress database error Table DATABASE.PREFIX_groups_capability doesn't exist for query

SELECT * FROM PREFIX_groups_capability WHERE capability = 'edit_posts'

made by:

  1. include('wp-admin/admin-header.php'),
  2. do_action('in_admin_header'),
  3. WP_Hook->do_action,
  4. WP_Hook->apply_filters,
  5. call_user_func_array,
  6. wp_admin_bar_render,
  7. do_action_ref_array,
  8. WP_Hook->do_action,
  9. WP_Hook->apply_filters,
  10. call_user_func_array,
  11. wp_admin_bar_my_sites_menu,
  12. current_user_can,
  13. call_user_func_array,
  14. WP_User->has_cap,
  15. apply_filters('user_has_cap'),
  16. WP_Hook->apply_filters,
  17. call_user_func_array,
  18. Groups_WordPress::user_has_cap,
  19. Groups_User->can,
  20. apply_filters_ref_array,
  21. WP_Hook->apply_filters,
  22. call_user_func_array,
  23. Groups_WordPress::groups_user_can,
  24. Groups_Capability::read_by_capability,
  25. QM_DB->query,

referer: SITE/wp-admin/index.php

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.