Groups - Version 1.13.1

Version Description

  • Fixed an issue where the wrong post count would be produced for statuses that do not represent a valid WooCommerce order status.
  • Added support for post counts with WooCommerce Subscriptions.
Download this release

Release Info

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

Code changes from version 1.13.0 to 1.13.1

changelog.txt CHANGED
@@ -1,5 +1,9 @@
1
  == Groups changelog.txt ==
2
 
 
 
 
 
3
  = 1.13.0 =
4
  * Added a filter on wp_count_posts.
5
 
1
  == Groups changelog.txt ==
2
 
3
+ = 1.13.1 =
4
+ * Fixed an issue where the wrong post count would be produced for statuses that do not represent a valid WooCommerce order status.
5
+ * Added support for post counts with WooCommerce Subscriptions.
6
+
7
  = 1.13.0 =
8
  * Added a filter on wp_count_posts.
9
 
groups.php CHANGED
@@ -21,7 +21,7 @@
21
  * Plugin Name: Groups
22
  * Plugin URI: http://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
- * Version: 1.13.0
25
  * Author: itthinx
26
  * Author URI: http://www.itthinx.com
27
  * Donate-Link: http://www.itthinx.com
@@ -30,7 +30,7 @@
30
  if ( !defined( 'ABSPATH' ) ) {
31
  exit;
32
  }
33
- define( 'GROUPS_CORE_VERSION', '1.13.0' );
34
  define( 'GROUPS_FILE', __FILE__ );
35
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
36
  define( 'GROUPS_CORE_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
21
  * Plugin Name: Groups
22
  * Plugin URI: http://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
+ * Version: 1.13.1
25
  * Author: itthinx
26
  * Author URI: http://www.itthinx.com
27
  * Donate-Link: http://www.itthinx.com
30
  if ( !defined( 'ABSPATH' ) ) {
31
  exit;
32
  }
33
+ define( 'GROUPS_CORE_VERSION', '1.13.1' );
34
  define( 'GROUPS_FILE', __FILE__ );
35
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
36
  define( 'GROUPS_CORE_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
lib/access/class-groups-post-access.php CHANGED
@@ -449,10 +449,21 @@ class Groups_Post_Access {
449
  'numberposts' => -1, // all
450
  'suppress_filters' => 0
451
  );
 
452
  if ( function_exists( 'wc_get_order_statuses' ) && ( $type == 'shop_order' ) ) {
453
  $wc_order_statuses = array_keys( wc_get_order_statuses() );
454
  if ( !in_array( $post_status, $wc_order_statuses ) ) {
455
- $query_args['post_status'] = $wc_order_statuses;
 
 
 
 
 
 
 
 
 
 
456
  }
457
  }
458
  $posts = get_posts( $query_args );
449
  'numberposts' => -1, // all
450
  'suppress_filters' => 0
451
  );
452
+ // WooCommerce Orders
453
  if ( function_exists( 'wc_get_order_statuses' ) && ( $type == 'shop_order' ) ) {
454
  $wc_order_statuses = array_keys( wc_get_order_statuses() );
455
  if ( !in_array( $post_status, $wc_order_statuses ) ) {
456
+ // Skip getting the post count for this status as it's
457
+ // not a valid order status and WC would raise a PHP Notice.
458
+ continue;
459
+ }
460
+ }
461
+ // WooCommerce Subscriptions
462
+ if ( function_exists( 'wcs_get_subscription_statuses' ) && ( $type == 'shop_subscription' ) ) {
463
+ $wc_subscription_statuses = array_keys( wcs_get_subscription_statuses() );
464
+ if ( !in_array( $post_status, $wc_subscription_statuses ) ) {
465
+ // Skip as it's not a valid subscription status
466
+ continue;
467
  }
468
  }
469
  $posts = get_posts( $query_args );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.itthinx.com/plugins/groups
4
  Tags: access, access control, capability, capabilities, content, download, downloads, file, file access, files, group, groups, member, members, membership, memberships, paypal, permission, permissions, subscription, subscriptions, woocommerce
5
  Requires at least: 4.0
6
  Tested up to: 4.6
7
- Stable tag: 1.13.0
8
  License: GPLv3
9
 
10
  Groups is an efficient and powerful solution, providing group-based user membership management, group-based capabilities and content access control.
@@ -182,10 +182,14 @@ See also [Groups](http://www.itthinx.com/plugins/groups/)
182
 
183
  == Changelog ==
184
 
 
 
 
 
185
  = 1.13.0 =
186
  * Added a filter on wp_count_posts.
187
 
188
  == Upgrade Notice ==
189
 
190
- = 1.13.0 =
191
- This release corrects an issue related to the post counts displayed.
4
  Tags: access, access control, capability, capabilities, content, download, downloads, file, file access, files, group, groups, member, members, membership, memberships, paypal, permission, permissions, subscription, subscriptions, woocommerce
5
  Requires at least: 4.0
6
  Tested up to: 4.6
7
+ Stable tag: 1.13.1
8
  License: GPLv3
9
 
10
  Groups is an efficient and powerful solution, providing group-based user membership management, group-based capabilities and content access control.
182
 
183
  == Changelog ==
184
 
185
+ = 1.13.1 =
186
+ * Fixed an issue where the wrong post count would be produced for statuses that do not represent a valid WooCommerce order status.
187
+ * Added support for post counts with WooCommerce Subscriptions.
188
+
189
  = 1.13.0 =
190
  * Added a filter on wp_count_posts.
191
 
192
  == Upgrade Notice ==
193
 
194
+ = 1.13.1 =
195
+ This release fixes an issue with order counts displayed on the WooCommerce order screen.