Groups - Version 2.7.1

Version Description

Download this release

Release Info

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

Code changes from version 2.7.0 to 2.7.1

changelog.txt CHANGED
@@ -1,5 +1,10 @@
1
  == Groups by itthinx - changelog.txt ==
2
 
 
 
 
 
 
3
  = 2.7.0 =
4
  * WordPress 5.2 compatible.
5
  * Fixed translation loading to apply the user's locale when set.
1
  == Groups by itthinx - changelog.txt ==
2
 
3
+ = 2.7.1 =
4
+ * Improved UIE rendering for group choices and made it more resilient to load dependencies, Javascript execution order and pages where it is used.
5
+ * Fixed UIE rendering for group choices with the block editor which would unduly cap the list visually providing an awkward UX.
6
+ * Better jQuery dependency resilience on the Users screen.
7
+
8
  = 2.7.0 =
9
  * WordPress 5.2 compatible.
10
  * Fixed translation loading to apply the user's locale when set.
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: 2.7.0
25
  * Author: itthinx
26
  * Author URI: http://www.itthinx.com
27
  * Donate-Link: http://www.itthinx.com
@@ -32,7 +32,7 @@
32
  if ( !defined( 'ABSPATH' ) ) {
33
  exit;
34
  }
35
- define( 'GROUPS_CORE_VERSION', '2.7.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: http://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
+ * Version: 2.7.1
25
  * Author: itthinx
26
  * Author URI: http://www.itthinx.com
27
  * Donate-Link: http://www.itthinx.com
32
  if ( !defined( 'ABSPATH' ) ) {
33
  exit;
34
  }
35
+ define( 'GROUPS_CORE_VERSION', '2.7.1' );
36
  define( 'GROUPS_FILE', __FILE__ );
37
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
38
  define( 'GROUPS_CORE_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
lib/access/class-groups-access-meta-boxes.php CHANGED
@@ -82,10 +82,13 @@ class Groups_Access_Meta_Boxes {
82
  switch ( $pagenow ) {
83
  case 'upload.php' :
84
  case 'customize.php' :
 
 
85
  Groups_UIE::enqueue( 'select' );
86
  break;
87
  }
88
  }
 
89
  }
90
 
91
  /**
82
  switch ( $pagenow ) {
83
  case 'upload.php' :
84
  case 'customize.php' :
85
+ case 'edit-tags.php' : // @since 2.7.1 [1]
86
+ case 'term.php' : // @since 2.7.1 [1]
87
  Groups_UIE::enqueue( 'select' );
88
  break;
89
  }
90
  }
91
+ // [1] For cases when attachments can be added to terms, e.g. WC Product Category Thumbnail.
92
  }
93
 
94
  /**
lib/admin/class-groups-admin-users.php CHANGED
@@ -222,12 +222,12 @@ class Groups_Admin_Users {
222
  $box .= $nonce;
223
 
224
  $box .= '<script type="text/javascript">';
 
225
  $box .= 'if ( typeof jQuery !== "undefined" ) {';
226
- $box .= 'jQuery("document").ready(function(){';
227
  $box .= 'jQuery(".tablenav.top .alignleft.actions:last").after("<div id=\"groups-bulk-actions-block\" class=\"alignleft actions\"></div>");';
228
  $box .= 'jQuery("#group-bulk-actions").appendTo(jQuery("#groups-bulk-actions-block"));';
229
- $box .= '});';
230
- $box .= '}';
231
  $box .= '</script>';
232
 
233
  $output .= $box;
222
  $box .= $nonce;
223
 
224
  $box .= '<script type="text/javascript">';
225
+ $box .= 'document.addEventListener( "DOMContentLoaded", function() {';
226
  $box .= 'if ( typeof jQuery !== "undefined" ) {';
 
227
  $box .= 'jQuery(".tablenav.top .alignleft.actions:last").after("<div id=\"groups-bulk-actions-block\" class=\"alignleft actions\"></div>");';
228
  $box .= 'jQuery("#group-bulk-actions").appendTo(jQuery("#groups-bulk-actions-block"));';
229
+ $box .= '}'; // jQuery
230
+ $box .= '} );'; // document....
231
  $box .= '</script>';
232
 
233
  $output .= $box;
lib/views/class-groups-uie.php CHANGED
@@ -94,24 +94,34 @@ class Groups_UIE {
94
  public static function render_select( $selector = 'select.groups-uie', $script = true, $on_document_ready = true, $create = false ) {
95
  $output = '';
96
  if ( $script ) {
97
- $output .= '<script type="text/javascript">';
98
- $output .= 'if (typeof jQuery !== "undefined"){';
99
- if ( $on_document_ready ) {
100
- $output .= 'jQuery("document").ready(function(){';
101
- }
102
- switch( self::$select ) {
103
- case 'selectize' :
104
- $output .= sprintf(
105
- 'jQuery("%s").selectize({%splugins: ["remove_button"]});',
106
- $selector,
107
- $create ? 'create:true,' : ''
108
- );
109
- break;
110
  }
 
 
 
 
 
 
 
 
 
 
111
  if ( $on_document_ready ) {
112
- $output .= '});';
 
 
 
 
113
  }
114
- $output .= '}'; // typeof jQuery
115
  $output .= '</script>';
116
  }
117
  return $output;
94
  public static function render_select( $selector = 'select.groups-uie', $script = true, $on_document_ready = true, $create = false ) {
95
  $output = '';
96
  if ( $script ) {
97
+
98
+ $call_output = '';
99
+ if ( self::$select === 'selectize' ) {
100
+ $call_output .= 'if ( typeof jQuery !== "undefined" ) {';
101
+ $call_output .= sprintf(
102
+ 'jQuery("%s").selectize({%splugins: ["remove_button"]});',
103
+ $selector,
104
+ $create ? 'create:true,' : ''
105
+ );
106
+ $call_output .= '}';
 
 
 
107
  }
108
+
109
+ // Our selectize options will be hidden unless the block editor's components panel allows to overflow.
110
+ $output .= '<style type="text/css">';
111
+ $output .= '.components-panel { overflow: visible!important; }';
112
+ $output .= '</style>';
113
+ // Act immediately if DOMContentLoaded was already dispatched, otherwise defer to handler.
114
+ $output .= '<script type="text/javascript">';
115
+ $output .= 'if ( document.readyState === "complete" || document.readyState === "interactive" ) {';
116
+ $output .= $call_output;
117
+ $output .= '}';
118
  if ( $on_document_ready ) {
119
+ $output .= ' else {';
120
+ $output .= 'document.addEventListener( "DOMContentLoaded", function() {';
121
+ $output .= $call_output;
122
+ $output .= '} );'; // document....
123
+ $output .= '}'; // else
124
  }
 
125
  $output .= '</script>';
126
  }
127
  return $output;
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: groups, access, access control, membership, memberships, member, members,
5
  Requires at least: 4.6
6
  Tested up to: 5.2
7
  Requires PHP: 5.6.0
8
- Stable tag: 2.7.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: 4.6
6
  Tested up to: 5.2
7
  Requires PHP: 5.6.0
8
+ Stable tag: 2.7.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.