Version Description
Download this release
Release Info
Developer | shinephp |
Plugin | User Role Editor |
Version | 4.50.1 |
Comparing to | |
See all releases |
Code changes from version 4.50 to 4.50.1
- includes/classes/base-lib.php +7 -5
- includes/classes/capabilities-groups-manager.php +2 -2
- includes/classes/editor.php +22 -0
- readme.txt +5 -2
- user-role-editor.php +2 -2
includes/classes/base-lib.php
CHANGED
@@ -37,13 +37,13 @@ class URE_Base_Lib {
|
|
37 |
*/
|
38 |
protected function __construct($options_id) {
|
39 |
|
40 |
-
$this->multisite = function_exists('is_multisite') && is_multisite();
|
41 |
-
if ($this->multisite) {
|
42 |
// get Id of the 1st (main) blog
|
43 |
$this->main_blog_id = $this->get_main_site();
|
44 |
}
|
45 |
|
46 |
-
$this->init_options($options_id);
|
47 |
|
48 |
}
|
49 |
// end of __construct()
|
@@ -85,9 +85,11 @@ class URE_Base_Lib {
|
|
85 |
/**
|
86 |
* get current options for this plugin
|
87 |
*/
|
88 |
-
protected function init_options($options_id) {
|
|
|
89 |
$this->options_id = $options_id;
|
90 |
-
$this->options = get_option($options_id);
|
|
|
91 |
}
|
92 |
// end of init_options()
|
93 |
|
37 |
*/
|
38 |
protected function __construct($options_id) {
|
39 |
|
40 |
+
$this->multisite = function_exists( 'is_multisite' ) && is_multisite();
|
41 |
+
if ( $this->multisite ) {
|
42 |
// get Id of the 1st (main) blog
|
43 |
$this->main_blog_id = $this->get_main_site();
|
44 |
}
|
45 |
|
46 |
+
$this->init_options( $options_id );
|
47 |
|
48 |
}
|
49 |
// end of __construct()
|
85 |
/**
|
86 |
* get current options for this plugin
|
87 |
*/
|
88 |
+
protected function init_options( $options_id ) {
|
89 |
+
|
90 |
$this->options_id = $options_id;
|
91 |
+
$this->options = get_option( $options_id );
|
92 |
+
|
93 |
}
|
94 |
// end of init_options()
|
95 |
|
includes/classes/capabilities-groups-manager.php
CHANGED
@@ -80,8 +80,8 @@ class URE_Capabilities_Groups_Manager {
|
|
80 |
|
81 |
private function add_woocommerce_groups() {
|
82 |
|
83 |
-
$full_caps = $this->lib->
|
84 |
-
if (!isset($full_caps['manage_woocommerce'])) {
|
85 |
return;
|
86 |
}
|
87 |
|
80 |
|
81 |
private function add_woocommerce_groups() {
|
82 |
|
83 |
+
$full_caps = $this->lib->init_full_capabilities( 'role' );
|
84 |
+
if ( !isset( $full_caps['manage_woocommerce'] ) ) {
|
85 |
return;
|
86 |
}
|
87 |
|
includes/classes/editor.php
CHANGED
@@ -554,6 +554,28 @@ class URE_Editor {
|
|
554 |
// end of update_roles()
|
555 |
|
556 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
557 |
/**
|
558 |
* Update user roles and capabilities
|
559 |
*
|
554 |
// end of update_roles()
|
555 |
|
556 |
|
557 |
+
/**
|
558 |
+
* if existing user was not added to the current blog - add him
|
559 |
+
* @global type $blog_id
|
560 |
+
* @param type $user
|
561 |
+
* @return bool
|
562 |
+
*/
|
563 |
+
protected function check_blog_user( $user ) {
|
564 |
+
global $blog_id;
|
565 |
+
|
566 |
+
$result = true;
|
567 |
+
if ( is_network_admin() ) {
|
568 |
+
if (!array_key_exists( $blog_id, get_blogs_of_user( $user->ID ) ) ) {
|
569 |
+
$result = add_existing_user_to_blog( array( 'user_id' => $user->ID, 'role' => 'subscriber' ) );
|
570 |
+
}
|
571 |
+
}
|
572 |
+
|
573 |
+
return $result;
|
574 |
+
}
|
575 |
+
// end of check_blog_user()
|
576 |
+
|
577 |
+
|
578 |
+
|
579 |
/**
|
580 |
* Update user roles and capabilities
|
581 |
*
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ 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¤cy_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.1
|
7 |
Stable tag: 4.50
|
8 |
Requires PHP: 5.5
|
9 |
License: GPLv2 or later
|
@@ -80,8 +80,11 @@ https://translate.wordpress.org/projects/wp-plugins/user-role-editor/
|
|
80 |
|
81 |
|
82 |
== Changelog =
|
|
|
|
|
|
|
83 |
|
84 |
-
= [4.50] 03.
|
85 |
* PHP version 5.5 was marked as required.
|
86 |
* Update: General code restructure and optimization.
|
87 |
* Update: URE_Base_Lib::get_blog_ids() returns null, if it's called under WordPress single site (not multisite).
|
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¤cy_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.1.1
|
7 |
Stable tag: 4.50
|
8 |
Requires PHP: 5.5
|
9 |
License: GPLv2 or later
|
80 |
|
81 |
|
82 |
== Changelog =
|
83 |
+
= [4.50.1] 16.03.2019 =
|
84 |
+
* Fix: WP Multisite: Users->Capabilities->Update: "Fatal error: Uncaught Error: Call to undefined method URE_Editor::check_blog_user() in /wp-content/plugins/user-role-editor/includes/classes/editor.php on line 576" was fixed.
|
85 |
+
* Fix: WooCommerce group was not shown under "Custom capabilities" section.
|
86 |
|
87 |
+
= [4.50] 03.03.2019 =
|
88 |
* PHP version 5.5 was marked as required.
|
89 |
* Update: General code restructure and optimization.
|
90 |
* Update: URE_Base_Lib::get_blog_ids() returns null, if it's called under WordPress single site (not multisite).
|
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.50
|
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.50' );
|
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.50.1
|
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.50.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__ ) );
|