Groups - Version 1.11.1

Version Description

  • Fixed the order_by and order parameters in Groups_Group::get_groups()
Download this release

Release Info

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

Code changes from version 1.11.0 to 1.11.1

Files changed (3) hide show
  1. groups.php +2 -2
  2. lib/core/class-groups-group.php +14 -5
  3. readme.txt +6 -3
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.11.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.11.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.11.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.11.1' );
34
  define( 'GROUPS_FILE', __FILE__ );
35
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
36
  define( 'GROUPS_CORE_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
lib/core/class-groups-group.php CHANGED
@@ -556,21 +556,30 @@ class Groups_Group implements I_Capable {
556
  }
557
  }
558
 
 
 
 
 
 
 
 
 
 
 
 
 
 
559
  if ( !isset( $order_by ) ) {
560
  $order_by = "";
561
  } else {
562
  $order_by = sanitize_text_field( $order_by );
563
- switch( trim( $field ) ) {
564
  case 'group_id' :
565
  case 'parent_id' :
566
  case 'creator_id' :
567
  case 'datetime' :
568
  case 'name' :
569
  case 'description' :
570
- $order = '';
571
- if ( !isset( $order ) || ( !( $order == 'ASC' ) && !( $order == 'DESC' ) ) ) {
572
- $order = 'DESC';
573
- }
574
  $order_by = $wpdb->prepare( " ORDER BY %s $order ", array( $order_by ) );
575
  break;
576
  default :
556
  }
557
  }
558
 
559
+ if ( !isset( $order ) ) {
560
+ $order = '';
561
+ } else {
562
+ $order = strtoupper( sanitize_text_field( trim( $order ) ) );
563
+ switch( $order ) {
564
+ case 'ASC' :
565
+ case 'DESC' :
566
+ break;
567
+ default :
568
+ $order = 'ASC';
569
+ }
570
+ }
571
+
572
  if ( !isset( $order_by ) ) {
573
  $order_by = "";
574
  } else {
575
  $order_by = sanitize_text_field( $order_by );
576
+ switch( trim( $order_by ) ) {
577
  case 'group_id' :
578
  case 'parent_id' :
579
  case 'creator_id' :
580
  case 'datetime' :
581
  case 'name' :
582
  case 'description' :
 
 
 
 
583
  $order_by = $wpdb->prepare( " ORDER BY %s $order ", array( $order_by ) );
584
  break;
585
  default :
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.5.3
7
- Stable tag: 1.11.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,6 +182,9 @@ See also [Groups](http://www.itthinx.com/plugins/groups/)
182
 
183
  == Changelog ==
184
 
 
 
 
185
  = 1.11.0 =
186
  * Added the Brazilian Portuguese translation.
187
 
@@ -533,5 +536,5 @@ Some installations wouldn't work correctly, showing no capabilities and making i
533
 
534
  == Upgrade Notice ==
535
 
536
- = 1.11.0 =
537
- This release adds the translation for Brazilian Portuguese.
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.5.3
7
+ Stable tag: 1.11.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.11.1 =
186
+ * Fixed the order_by and order parameters in Groups_Group::get_groups()
187
+
188
  = 1.11.0 =
189
  * Added the Brazilian Portuguese translation.
190
 
536
 
537
  == Upgrade Notice ==
538
 
539
+ = 1.11.1 =
540
+ This release provides minor fixes in the API.