User Role Editor - Version 4.45

Version Description

Download this release

Release Info

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

Code changes from version 4.44 to 4.45

includes/classes/capabilities-groups-manager.php CHANGED
@@ -72,7 +72,7 @@ class URE_Capabilities_Groups_Manager {
72
 
73
  private function add_ure_group() {
74
 
75
- $this->groups['user_role_editor'] = array('caption'=>esc_html__('User Role Editor', 'user-role-editor'), 'parent'=>'custom', 'level'=>3);
76
 
77
  }
78
  // end of get_ure_group()
@@ -87,13 +87,13 @@ class URE_Capabilities_Groups_Manager {
87
 
88
  $post_types = get_post_types(array(), 'objects');
89
 
90
- $this->groups['woocommerce'] = array('caption'=>esc_html__('WooCommerce', 'user-role-editor'), 'parent'=>'custom', 'level'=>3);
91
- $this->groups['woocommerce_core'] = array('caption'=>esc_html__('Core', 'user-role-editor'), 'parent'=>'woocommerce', 'level'=>4);
92
  foreach(URE_Woocommerce_Capabilities::$post_types as $post_type) {
93
  if (!isset($post_types[$post_type])) {
94
  continue;
95
  }
96
- $this->groups['woocommerce_'. $post_type] = array('caption'=>$post_types[$post_type]->labels->name, 'parent'=>'woocommerce', 'level'=>4);
97
  }
98
 
99
  }
72
 
73
  private function add_ure_group() {
74
 
75
+ $this->groups['user_role_editor'] = array('caption'=>esc_html__('User Role Editor', 'user-role-editor'), 'parent'=>'custom', 'level'=>2);
76
 
77
  }
78
  // end of get_ure_group()
87
 
88
  $post_types = get_post_types(array(), 'objects');
89
 
90
+ $this->groups['woocommerce'] = array('caption'=>esc_html__('WooCommerce', 'user-role-editor'), 'parent'=>'custom', 'level'=>2);
91
+ $this->groups['woocommerce_core'] = array('caption'=>esc_html__('Core', 'user-role-editor'), 'parent'=>'woocommerce', 'level'=>3);
92
  foreach(URE_Woocommerce_Capabilities::$post_types as $post_type) {
93
  if (!isset($post_types[$post_type])) {
94
  continue;
95
  }
96
+ $this->groups['woocommerce_'. $post_type] = array('caption'=>$post_types[$post_type]->labels->name, 'parent'=>'woocommerce', 'level'=>3);
97
  }
98
 
99
  }
js/ure.js CHANGED
@@ -527,9 +527,9 @@ function ure_refresh_role_view(response) {
527
 
528
  ure_current_role = response.role_id;
529
  ure_current_role_name = response.role_name;
530
- // Select capabilities included to a newly selected role and exclude others
531
  jQuery('.ure-cap-cb').each(function () { // go through all capabilities checkboxes
532
- jQuery(this).prop('checked', response.caps.hasOwnProperty(this.id));
533
  });
534
 
535
  // Recalculate granted capabilities for capabilities groups
527
 
528
  ure_current_role = response.role_id;
529
  ure_current_role_name = response.role_name;
530
+ // Select capabilities granted to a newly selected role and exclude others
531
  jQuery('.ure-cap-cb').each(function () { // go through all capabilities checkboxes
532
+ jQuery(this).prop('checked', response.caps.hasOwnProperty(this.id) && response.caps[this.id]);
533
  });
534
 
535
  // Recalculate granted capabilities for capabilities groups
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: 4.9.7
7
- Stable tag: 4.44
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,7 +12,7 @@ User Role Editor WordPress plugin makes user roles and capabilities changing eas
12
 
13
  == Description ==
14
 
15
- With User Role Editor WordPress plugin you can change user role (except Administrator) capabilities easy, with a few clicks.
16
  Just turn on check boxes of capabilities you wish to add to the selected role and click "Update" button to save your changes. That's done.
17
  Add new roles and customize its capabilities according to your needs, from scratch of as a copy of other existing role.
18
  Unnecessary self-made role can be deleted if there are no users whom such role is assigned.
@@ -33,7 +33,7 @@ Do you need more functionality with quality support in a real time? Do you wish
33
  <li>Block selected widgets under "Appearance" menu for role.</li>
34
  <li>Show widgets at front-end for selected roles.</li>
35
  <li>Block selected meta boxes (dashboard, posts, pages, custom post types) for role.</li>
36
- <li>"Export/Import" module. You can export user roles to the local file and import them then to any WordPress site or other sites of the multi-site WordPress network.</li>
37
  <li>Roles and Users permissions management via Network Admin for multisite configuration. One click Synchronization to the whole network.</li>
38
  <li>"Other roles access" module allows to define which other roles user with current role may see at WordPress: dropdown menus, e.g assign role to user editing user profile, etc.</li>
39
  <li>Manage user access to editing posts/pages/custom post type using posts/pages, authors, taxonomies ID list.</li>
@@ -79,6 +79,10 @@ https://translate.wordpress.org/projects/wp-plugins/user-role-editor/
79
 
80
 
81
  == Changelog =
 
 
 
 
82
  = [4.44] 05.07.2018 =
83
  * Update: URE had executed 'profile_update' action after update of user permissions from the user permissions editor page: Users->selected user->Capabilities.
84
  It was replaced with 'ure_user_permissions_update' action now. It will allow to exclude conflicts with other plugins - "WP Members" [lost checkbox fields values](https://wordpress.org/support/topic/conflict-with-wp-members-2/), for example.
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: 4.9.8
7
+ Stable tag: 4.45
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ User Role Editor WordPress plugin allows you to change user roles and capabilities easy.
16
  Just turn on check boxes of capabilities you wish to add to the selected role and click "Update" button to save your changes. That's done.
17
  Add new roles and customize its capabilities according to your needs, from scratch of as a copy of other existing role.
18
  Unnecessary self-made role can be deleted if there are no users whom such role is assigned.
33
  <li>Block selected widgets under "Appearance" menu for role.</li>
34
  <li>Show widgets at front-end for selected roles.</li>
35
  <li>Block selected meta boxes (dashboard, posts, pages, custom post types) for role.</li>
36
+ <li>"Export/Import" module. You can export user role to the local file and import it to any WordPress site or other sites of the multi-site WordPress network.</li>
37
  <li>Roles and Users permissions management via Network Admin for multisite configuration. One click Synchronization to the whole network.</li>
38
  <li>"Other roles access" module allows to define which other roles user with current role may see at WordPress: dropdown menus, e.g assign role to user editing user profile, etc.</li>
39
  <li>Manage user access to editing posts/pages/custom post type using posts/pages, authors, taxonomies ID list.</li>
79
 
80
 
81
  == Changelog =
82
+ = [4.45] 18.08.2018 =
83
+ * Fix: Capability checkbox was shown as turned ON incorrectly for not granted capability included into a role, JSON: "caps":{"sample_cap":"false"}. Bug took place after the changing a currently selected role.
84
+ * Fix: Custom capabilities groups "User Role Editor" and "WooCommerce" were registered at the wrong 3rd tree level - changed to 2.
85
+
86
  = [4.44] 05.07.2018 =
87
  * Update: URE had executed 'profile_update' action after update of user permissions from the user permissions editor page: Users->selected user->Capabilities.
88
  It was replaced with 'ure_user_permissions_update' action now. It will allow to exclude conflicts with other plugins - "WP Members" [lost checkbox fields values](https://wordpress.org/support/topic/conflict-with-wp-members-2/), for example.
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.44
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.44');
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.45
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.45');
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__));