Forum Replies Created

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • ArieHeij
    Participant

    I have send you a mail.

    ArieHeij
    Participant

    Great thanks again for your great support.

    ArieHeij
    Participant

    Hi 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;
    }

    ArieHeij
    Participant

    Hi Vladimir,

    You have a mail with the dropbox share.

    ArieHeij
    Participant

    After 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.

    ArieHeij
    Participant

    Hi 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.

    ArieHeij
    Participant

    Hi 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.

    ArieHeij
    Participant

    Hi 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.

    ArieHeij
    Participant

    Hi Vladimir,

    That worked great. Thanks for the quick reply and solution. Great support.

    in reply to: Error 500 when using Post Edit Access #4803
    ArieHeij
    Participant

    No problem. Glad I could help.
    Thanks again.

    in reply to: Error 500 when using Post Edit Access #4801
    ArieHeij
    Participant

    Hi 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

    in reply to: Error 500 when using Post Edit Access #4799
    ArieHeij
    Participant

    great thanks.

    in reply to: Error 500 when using Post Edit Access #4797
    ArieHeij
    Participant

    Vladimir,

    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.

    in reply to: Error 500 when using Post Edit Access #4795
    ArieHeij
    Participant

    Hi 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.

    in reply to: Error 500 when using Post Edit Access #4794
    ArieHeij
    Participant

    An 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.

Viewing 15 posts - 1 through 15 (of 17 total)