Change WordPress user roles and capabilities › Forums › Bug Reports › Plugin access addon editing doesn't take effect immediately on new users.
- This topic has 7 replies, 2 voices, and was last updated 5 years, 8 months ago by Vladimir.
-
AuthorPosts
-
18/03/2019 at 22:03 #5598armelParticipant
I just realised that when a new user is created, the restriction applied to the plugin admin menu access for that role are not taken into effect automatically.
The user role should first be network upgraded again before the settings are then applied to the new user. See video below for illustration.https://www.useloom.com/share/461ff77c42084043b66ac9b5a09c67e6
Is there a way to fix this?
19/03/2019 at 15:10 #5599VladimirKeymasterThanks for this report. I will re-test the code, which replicates add-ons data from the main site to the new registered site with roles together.
20/03/2019 at 10:46 #5600armelParticipantOk,
I will be waiting for your update.
Thanks
21/03/2019 at 15:08 #5605VladimirKeymasterI confirm a problem with add-ons data replication from the main site to the new created one. They were not replicated as automatic replication of add-ons data is switched off by default. You need to set custom filter in order to tell to URE what add-ons data to replicate. Filter is: ure_addons_to_copy_for_new_blog.
In order to replicate “Plugins access” add-on data this line is needed additionally:$addons['plugins']->copy = true;
2nd possible issue: Current version of URE uses ‘wpmu_new_blog’ action to execute own function for roles data replication. Starting from WordPress 5.1 this action was deprecated and process of new site creation was rewritten.
I developed the fix. It’s currently available as the beta version 4.50.4.b1.22/03/2019 at 13:23 #5609armelParticipantI tried to install the beta version but it didnt fix the issue.
I have created a custom plugin with the filter you sent me but this doesn’t work either. The code I have added in the plugin are below. Is this exactly what you requested to do?
<?php
add_filter(‘ure_addons_to_copy_for_new_blog’, ‘ure_addons_to_copy_for_new_blog’, 10, 1);
function ure_addons_to_copy_for_new_blog($addons) {
$addons[‘admin_menu’]->copy = true;
$addons[‘widgets_admin’]->copy = true;
$addons[‘widgets_show’]->copy = true;
$addons[‘meta_boxes’]->copy = true;
$addons[‘other_roles’]->copy = true;
$addons[‘plugins’]->copy = true;
return $addons;
}22/03/2019 at 13:57 #5610VladimirKeymasterIs it possible to check online? If ‘Yes’, send site link and superadmin credentials to support [at-sign] role-editor.com.
25/03/2019 at 03:17 #5614VladimirKeymasterLet’s clarify the things:
2 things should be made together:
1) use beta version of URE which includes a fix;
2) properly install a custom code (you listed above).I see that your site uses currently the stable version of URE 4.50.3. It has a related issue after WordPress 5.1 release and discussed feature does not work under it.
28/03/2019 at 03:41 #5617VladimirKeymasterThanks for your constructive collaboration.
I found and fixed the issue, prevented to add-ons data copy to a new subsite in your case:
– Fix: WordPress multisite: add-ons data from the main site was not copied to a new subsite in case new subsite was created from front-end.Let’s try the next beta version: 4.50.4.b2.
-
AuthorPosts
- You must be logged in to reply to this topic.