Groups - Version 2.11.1

Version Description

Download this release

Release Info

Developer itthinx
Plugin Icon 128x128 Groups
Version 2.11.1
Comparing to
See all releases

Code changes from version 2.11.0 to 2.11.1

Files changed (4) hide show
  1. changelog.txt +3 -0
  2. groups.php +2 -2
  3. lib/wp/class-groups-wordpress.php +14 -1
  4. readme.txt +1 -1
changelog.txt CHANGED
@@ -1,5 +1,8 @@
1
  == Groups by itthinx - changelog.txt
2
 
 
 
 
3
  = 2.11.0 =
4
  * WordPress 5.5 compatible.
5
  * Minimum WordPress version 5.2 is required.
1
  == Groups by itthinx - changelog.txt
2
 
3
+ = 2.11.1 =
4
+ * Fixes missing capabilities with user_has_cap filter processing modified in 2.11.0.
5
+
6
  = 2.11.0 =
7
  * WordPress 5.5 compatible.
8
  * Minimum WordPress version 5.2 is required.
groups.php CHANGED
@@ -21,7 +21,7 @@
21
  * Plugin Name: Groups
22
  * Plugin URI: https://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
- * Version: 2.11.0
25
  * Author: itthinx
26
  * Author URI: https://www.itthinx.com
27
  * Donate-Link: https://www.itthinx.com/shop/
@@ -32,7 +32,7 @@
32
  if ( !defined( 'ABSPATH' ) ) {
33
  exit;
34
  }
35
- define( 'GROUPS_CORE_VERSION', '2.11.0' );
36
  define( 'GROUPS_FILE', __FILE__ );
37
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
38
  define( 'GROUPS_CORE_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
21
  * Plugin Name: Groups
22
  * Plugin URI: https://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
+ * Version: 2.11.1
25
  * Author: itthinx
26
  * Author URI: https://www.itthinx.com
27
  * Donate-Link: https://www.itthinx.com/shop/
32
  if ( !defined( 'ABSPATH' ) ) {
33
  exit;
34
  }
35
+ define( 'GROUPS_CORE_VERSION', '2.11.1' );
36
  define( 'GROUPS_FILE', __FILE__ );
37
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
38
  define( 'GROUPS_CORE_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
lib/wp/class-groups-wordpress.php CHANGED
@@ -116,8 +116,21 @@ class Groups_WordPress {
116
  $cached = Groups_Cache::get( self::HAS_CAP . '_' . $user_id . '_' . $hash, self::CACHE_GROUP );
117
 
118
  if ( $cached !== null ) {
119
- $allcaps = $cached->value;
120
  unset( $cached );
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  } else {
122
  $groups_user = new Groups_User( $user_id );
123
  // we need to deactivate this because invoking $groups_user->can()
116
  $cached = Groups_Cache::get( self::HAS_CAP . '_' . $user_id . '_' . $hash, self::CACHE_GROUP );
117
 
118
  if ( $cached !== null ) {
119
+ $_allcaps = $cached->value;
120
  unset( $cached );
121
+ // Capabilities that were added after our value was cached must be added and
122
+ // those entries that provide different values must be adopted. This is necessary
123
+ // because other filters which hook into user_has_cap might have added or modified
124
+ // things after we had already cached the values.
125
+ foreach ( $allcaps as $cap => $value ) {
126
+ if (
127
+ !key_exists( $cap, $_allcaps ) ||
128
+ $_allcaps[$cap] !== $value
129
+ ) {
130
+ $_allcaps[$cap] = $value;
131
+ }
132
+ }
133
+ $allcaps = $_allcaps;
134
  } else {
135
  $groups_user = new Groups_User( $user_id );
136
  // we need to deactivate this because invoking $groups_user->can()
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: groups, access, access control, membership, memberships, member, members,
5
  Requires at least: 5.2
6
  Tested up to: 5.5
7
  Requires PHP: 5.6.0
8
- Stable tag: 2.11.0
9
  License: GPLv3
10
 
11
  Groups is an efficient and powerful solution, providing group-based user membership management, group-based capabilities and content access control.
5
  Requires at least: 5.2
6
  Tested up to: 5.5
7
  Requires PHP: 5.6.0
8
+ Stable tag: 2.11.1
9
  License: GPLv3
10
 
11
  Groups is an efficient and powerful solution, providing group-based user membership management, group-based capabilities and content access control.