User Role Editor - Version 4.54

Version Description

Download this release

Release Info

Developer shinephp
Plugin Icon 128x128 User Role Editor
Version 4.54
Comparing to
See all releases

Code changes from version 4.53.1 to 4.54

changelog.txt CHANGED
@@ -1,5 +1,8 @@
1
  CHANGES LOG (full version).
2
  ===========================
 
 
 
3
 
4
  = [4.53.1] 22.03.2020 =
5
  * New: "Hide Pro banner" checkbox works via AJAX without full page refresh.
1
  CHANGES LOG (full version).
2
  ===========================
3
+ = [4.54] 02.05.2020 =
4
+ New: Quick filter hides capabilities, which do not contain search string
5
+ Update: CSS enhancement: When site has many custom post types capabilities list section maximal height is limited by real height of the left side (capabilities groups) section, not by 720px as earlier.
6
 
7
  = [4.53.1] 22.03.2020 =
8
  * New: "Hide Pro banner" checkbox works via AJAX without full page refresh.
css/ure-admin.css CHANGED
@@ -68,7 +68,7 @@ input.warning:hover, a.warning:hover {
68
  padding-left: 20px;
69
  }
70
 
71
- .hidden {
72
  display: none;
73
  }
74
 
68
  padding-left: 20px;
69
  }
70
 
71
+ .filtered, .hidden {
72
  display: none;
73
  }
74
 
includes/classes/capabilities-groups-manager.php CHANGED
@@ -260,22 +260,28 @@ class URE_Capabilities_Groups_Manager {
260
  * @param array $post_edit_caps
261
  */
262
  private function get_registered_cpt_caps($post_type, $post_edit_caps) {
 
263
  foreach ($post_edit_caps as $capability) {
264
  if (isset($post_type->cap->$capability)) {
265
  $cap = $post_type->cap->$capability;
266
  } else {
267
  continue;
268
  }
269
- if (isset($this->cpt_caps[$cap])) {
 
 
270
  continue;
 
 
 
 
271
  }
272
- $this->cpt_caps[$cap] = array();
273
- if (!isset($this->built_in_wp_caps[$cap])) {
274
- $this->cpt_caps[$cap][] = 'custom';
275
- }
276
- $this->cpt_caps[$cap][] = 'custom_post_types';
277
- $this->cpt_caps[$cap][] = $post_type->name;
278
  }
 
279
  }
280
  // end of get_registered_cpt_caps()
281
 
260
  * @param array $post_edit_caps
261
  */
262
  private function get_registered_cpt_caps($post_type, $post_edit_caps) {
263
+
264
  foreach ($post_edit_caps as $capability) {
265
  if (isset($post_type->cap->$capability)) {
266
  $cap = $post_type->cap->$capability;
267
  } else {
268
  continue;
269
  }
270
+ if ( !isset( $this->cpt_caps[$cap] ) ) {
271
+ $this->cpt_caps[$cap] = array();
272
+ } else if ( in_array( $post_type->name, $this->cpt_caps[$cap] ) ) {
273
  continue;
274
+ }
275
+ if ( !isset($this->built_in_wp_caps[$cap]) &&
276
+ !in_array( 'custom', $this->cpt_caps[$cap] ) ) {
277
+ $this->cpt_caps[$cap][] = 'custom';
278
  }
279
+ if ( !in_array( 'custom_post_types', $this->cpt_caps[$cap] ) ) {
280
+ $this->cpt_caps[$cap][] = 'custom_post_types';
281
+ }
282
+ $this->cpt_caps[$cap][] = $post_type->name;
 
 
283
  }
284
+
285
  }
286
  // end of get_registered_cpt_caps()
287
 
js/ure.js CHANGED
@@ -296,8 +296,13 @@ var ure_main = {
296
 
297
 
298
  sizes_update: function () {
 
299
  var width = jQuery('#ure_caps_td').css('width');
300
- jQuery('#ure_caps_list_container').css('width', width);
 
 
 
 
301
  },
302
 
303
 
@@ -926,12 +931,21 @@ var ure_main = {
926
  filter_capabilities: function( cap_id ) {
927
  var div_list = jQuery('.ure-cap-div');
928
  for (var i = 0; i < div_list.length; i++) {
929
- if (cap_id !== '' && div_list[i].id.substr(11).indexOf(cap_id) !== -1) {
930
- jQuery('#'+ div_list[i].id).addClass('ure_tag');
931
- div_list[i].style.color = '#27CF27';
 
 
 
 
 
 
 
 
932
  } else {
 
 
933
  div_list[i].style.color = '#000000';
934
- jQuery('#'+ div_list[i].id).removeClass('ure_tag');
935
  }
936
  }
937
 
296
 
297
 
298
  sizes_update: function () {
299
+
300
  var width = jQuery('#ure_caps_td').css('width');
301
+ var el = jQuery('#ure_caps_list_container');
302
+ el.css('width', width);
303
+ var height = jQuery('#ure_caps_td').css('height');
304
+ el.css('max-height', height);
305
+
306
  },
307
 
308
 
931
  filter_capabilities: function( cap_id ) {
932
  var div_list = jQuery('.ure-cap-div');
933
  for (var i = 0; i < div_list.length; i++) {
934
+ var el = jQuery('#'+ div_list[i].id);
935
+ if ( cap_id !== '' ) {
936
+ if (div_list[i].id.substr(11).indexOf(cap_id) !== -1 ) {
937
+ el.addClass('ure_tag');
938
+ el.removeClass('filtered');
939
+ div_list[i].style.color = '#27CF27';
940
+ } else {
941
+ el.removeClass('ure_tag');
942
+ el.addClass('filtered');
943
+ div_list[i].style.color = '#000000';
944
+ }
945
  } else {
946
+ el.removeClass('ure_tag');
947
+ el.removeClass('filtered');
948
  div_list[i].style.color = '#000000';
 
949
  }
950
  }
951
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: shinephp
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=vladimir%40shinephp%2ecom&lc=RU&item_name=ShinePHP%2ecom&item_number=User%20Role%20Editor%20WordPress%20plugin&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
4
  Tags: user, role, editor, security, access, permission, capability
5
  Requires at least: 4.0
6
- Tested up to: 5.4
7
- Stable tag: 4.53.1
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -80,6 +80,13 @@ https://translate.wordpress.org/projects/wp-plugins/user-role-editor/
80
 
81
 
82
  == Changelog =
 
 
 
 
 
 
 
83
 
84
  = [4.53.1] 22.03.2020 =
85
  * New: "Hide Pro banner" checkbox works via AJAX without full page refresh.
@@ -91,15 +98,6 @@ https://translate.wordpress.org/projects/wp-plugins/user-role-editor/
91
  * Update: Multisite: "Allow non super administrators to create, edit, and delete users" option: priority for 'map_meta_cap' filter priority was raised from 1 to 99, in order make possible to overwrite changes made by other plugins, like WooCommerce.
92
  * Fix: Some English grammar mistakes.
93
 
94
- = [4.52.2] 26.12.2019 =
95
- * Fix: Custom capabilities for custom post types was not created by URE automatically since version 4.52.1.
96
- * Fix: 'administrator' role protection did not show to power users roles with 'administrator' word inside, like 'shop_administrator', etc.
97
-
98
- = [4.52.1] 11.11.2019 =
99
- * Update: URE requires PHP version 5.6.
100
- * ure_cpt_editor_roles filter was added. It takes 2 parameters: array $roles with 1 element 'administrator' by default and $post_type with post type name string. Add other role(s) to which you wish automatically add all user capabilities for custom post type $post_type. URE updates roles this way before opening "Users->User Role Editor" page.
101
- * New user capability 'ure_nav_menus_access' was added. It's used at the User Role Editor Pro only.
102
-
103
  File changelog.txt contains the full list of changes.
104
 
105
  == Additional Documentation ==
@@ -109,7 +107,6 @@ You can find more information about "User Role Editor" plugin at [this page](htt
109
  I am ready to answer on your questions about plugin usage. Use [plugin page comments](http://www.shinephp.com/user-role-editor-wordpress-plugin/) for that.
110
 
111
  == Upgrade Notice ==
112
- = [4.53.1] 22.03.2020 =
113
- * New: "Hide Pro banner" checkbox works via AJAX without full page refresh.
114
- * Fix: Undefined variable: message at wp-content/plugins/user-role-editor/includes/classes/editor.php:898
115
- * Update: Few English grammar enhancements.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=vladimir%40shinephp%2ecom&lc=RU&item_name=ShinePHP%2ecom&item_number=User%20Role%20Editor%20WordPress%20plugin&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
4
  Tags: user, role, editor, security, access, permission, capability
5
  Requires at least: 4.0
6
+ Tested up to: 5.4.1
7
+ Stable tag: 4.54
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
80
 
81
 
82
  == Changelog =
83
+ = [4.54] 02.05.2020 =
84
+ * New: Quick filter hides capabilities, which do not contain search string
85
+ * Update: CSS enhancement: When site has many custom post types capabilities list section maximal height is limited by real height of the left side (capabilities groups) section, not by 720px as earlier.
86
+
87
+ = [4.53.2] 03.04.2020 =
88
+ * Fix: Empty list of capabilities (0/0) was shown for custom post types (CPT) which are defined with the same capability type as another CPT.
89
+ For example courses CPT from LearnDash plugin is defined with 'course' capability type (edit_courses, etc.) and other CPT from LearnDash were shown with 0/0 capabilities (lessons, topics, quizzes, certificates).
90
 
91
  = [4.53.1] 22.03.2020 =
92
  * New: "Hide Pro banner" checkbox works via AJAX without full page refresh.
98
  * Update: Multisite: "Allow non super administrators to create, edit, and delete users" option: priority for 'map_meta_cap' filter priority was raised from 1 to 99, in order make possible to overwrite changes made by other plugins, like WooCommerce.
99
  * Fix: Some English grammar mistakes.
100
 
 
 
 
 
 
 
 
 
 
101
  File changelog.txt contains the full list of changes.
102
 
103
  == Additional Documentation ==
107
  I am ready to answer on your questions about plugin usage. Use [plugin page comments](http://www.shinephp.com/user-role-editor-wordpress-plugin/) for that.
108
 
109
  == Upgrade Notice ==
110
+ = [4.54] 02.05.2020 =
111
+ * New: Quick filter hides capabilities, which do not contain search string
112
+ * Update: CSS enhancement: When site has many custom post types capabilities list section maximal height is limited by real height of the left side (capabilities groups) section, not by 720px as earlier.
 
user-role-editor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: User Role Editor
4
  Plugin URI: https://www.role-editor.com
5
  Description: Change/add/delete WordPress user roles and capabilities.
6
- Version: 4.53.1
7
  Author: Vladimir Garagulya
8
  Author URI: https://www.role-editor.com
9
  Text Domain: user-role-editor
@@ -23,7 +23,7 @@ if ( defined( 'URE_PLUGIN_URL' ) ) {
23
  wp_die( 'It seems that other version of User Role Editor is active. Please deactivate it before use this version' );
24
  }
25
 
26
- define( 'URE_VERSION', '4.53.1' );
27
  define( 'URE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
28
  define( 'URE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
29
  define( 'URE_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) );
3
  Plugin Name: User Role Editor
4
  Plugin URI: https://www.role-editor.com
5
  Description: Change/add/delete WordPress user roles and capabilities.
6
+ Version: 4.54
7
  Author: Vladimir Garagulya
8
  Author URI: https://www.role-editor.com
9
  Text Domain: user-role-editor
23
  wp_die( 'It seems that other version of User Role Editor is active. Please deactivate it before use this version' );
24
  }
25
 
26
+ define( 'URE_VERSION', '4.54' );
27
  define( 'URE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
28
  define( 'URE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
29
  define( 'URE_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) );