Forum Replies Created
-
AuthorPosts
-
ArieHeijParticipant
I have send you a mail.
03/05/2018 at 09:05 in reply to: Limit user to changing a single page & add events through multiple plugins #4829ArieHeijParticipantGreat thanks again for your great support.
03/05/2018 at 08:22 in reply to: Limit user to changing a single page & add events through multiple plugins #4827ArieHeijParticipantHi Vladimir,
Thanks for the support, it works great. Just for my state of mind i added another user role like this, I think I did it correct as everything worked. Can you say if I did it correctly? Thanks.
// User role editor pro – Show all attachments for all roles
add_filter(‘ure_attachments_show_full_list’, ‘show_full_list_of_attachments’, 10, 1);
function show_full_list_of_attachments($show_all) {
$current_user = wp_get_current_user();
if (!in_array(‘hetbakenbeheren’, $current_user->roles) && !in_array(‘jaarboekje’, $current_user->roles) && !in_array(‘dominee’, $current_user->roles) &&
!in_array(‘kerkdienstplanning’, $current_user->roles)) {
return $show_all;
}return true;
}// ure_restrict_edit_post_type
add_filter(‘ure_restrict_edit_post_type’, ‘exclude_posts_from_edit_restrictions’);
function exclude_posts_from_edit_restrictions($post_type) {
$restrict_it = true;
$current_user = wp_get_current_user();
if (in_array($post_type, array(‘event’, ‘ctc_event’))) {
if (in_array(‘hetbakenbeheren’, $current_user->roles) && in_array(‘kerkdienstplanning’, $current_user->roles)) {
$restrict_it = false;
}
} elseif ($post_type==’ctc_sermon’) {
if (in_array(‘dominee’, $current_user->roles)) {
$restrict_it = false;
}
} elseif ($post_type==’tablepress’) {
if (in_array(‘jaarboekje’, $current_user->roles)) {
$restrict_it = false;
}
}return $restrict_it;
}03/05/2018 at 06:29 in reply to: Limit user to changing a single page & add events through multiple plugins #4823ArieHeijParticipantHi Vladimir,
You have a mail with the dropbox share.
02/05/2018 at 13:14 in reply to: Limit user to changing a single page & add events through multiple plugins #4817ArieHeijParticipantAfter some more testing I found out that the user role cannot make new posts in ctc_sermon, event and ctc_event with the new code. I get the message: You do not have permission to edit this item. But the user role has all the permissions that are needed to make a new item.
02/05/2018 at 06:59 in reply to: Limit user to changing a single page & add events through multiple plugins #4815ArieHeijParticipantHi Vladimir,
Thanks for the code. I tested the code and all the the pages that are entered at the post edit access are for all the user roles visible now, but now all the posts at the other posttypes (ctc_sermon, event, ctc_event) are not showing up and stays empty for the users roles.
01/05/2018 at 11:44 in reply to: Limit user to changing a single page & add events through multiple plugins #4813ArieHeijParticipantHi Vladimir,
I tested some more with other user role, but as soon as post edit access is enabled for some posts / categories in combination with the filter in the function.php and there is also an filter for other user role in the function.php then the post edit access restriction is not working. You get to see all the posts instead of the posts / categories which are put in the post edit access window.
I hope you can fix this because I have a few roles with need to have access to some posts and full access to another plugin. Thanks.30/04/2018 at 10:03 in reply to: Limit user to changing a single page & add events through multiple plugins #4812ArieHeijParticipantHi Vladimir,
I added an other filter to my functions.php for an other userrole with restrict_edit_post_type for 2 categories and full rights for ctc_sermon plugin. The problem is that for the user there are still post visible in an other categories.
When I remove one of the functions it works fine, but when the two functions are active exclude_posts_from_edit_restrictions1 doens’t enforce the allow 2 category restriction from rol dominee.My code looks like this now:
// ure_restrict_edit_post_type Hetbakenbeheren in combinatie met kerkdienstplanning
add_filter(‘ure_restrict_edit_post_type’, ‘exclude_posts_from_edit_restrictions’);
function exclude_posts_from_edit_restrictions($post_type) {
$restrict_it = true;
$current_user = wp_get_current_user();
if (!in_array(‘hetbakenbeheren’, $current_user->roles) || !in_array(‘kerkdienstplanning’, $current_user->roles)) {
return $restrict_it;
}$do_not_restrict = array(‘event’, ‘ctc_event’);
if (in_array($post_type, $do_not_restrict)) {
$restrict_it = false;
}return $restrict_it;
}// ure_restrict_edit_post_type Dominee in combinatie met preken
add_filter(‘ure_restrict_edit_post_type’, ‘exclude_posts_from_edit_restrictions1’);
function exclude_posts_from_edit_restrictions1($post_type) {
$restrict_it = true;
if (current_user_can(‘dominee’)) {
if ($post_type==’ctc_sermon’) {
$restrict_it = false;
}
}
return $restrict_it;
}Thanks.
26/04/2018 at 16:34 in reply to: Limit user to changing a single page & add events through multiple plugins #4806ArieHeijParticipantHi Vladimir,
That worked great. Thanks for the quick reply and solution. Great support.
ArieHeijParticipantNo problem. Glad I could help.
Thanks again.ArieHeijParticipantHi Vladimir,
I have tested 4.45.b2 and I can confirm that the issue has been fixed in this version.
Thanks for the quick fix.Kind regards,
Arie
ArieHeijParticipantgreat thanks.
ArieHeijParticipantVladimir,
I deactivated all plugins exept User Rol Editor and “ACF: Better Search” then I still got the 500 error. When I also disable “ACF: Better Search” then the error 500 doesn’t occurred anymore.
ArieHeijParticipantHi Vladimir,
I narrowed the problem down to the plugin: ACF: Better Search.
When that one is activated I get problems. I deactivated the plugin for now and it keeps working.
So it seems a combination problem between ACF: Better Search and Post Edit Access.Hope you can replicate the problem and make a fix for it.
Thanks.ArieHeijParticipantAn other thing I noticed is that when I’m logged on as this user and before I go to pages I click on media, the pages overview page is loading fine. When I click multiple times on pages then I get the error 500 again. When I then click on media again and then pages again it loads again.
This only acts up when the post id is filled at the Post edit Access menu.
-
AuthorPosts