Forum Replies Created

Viewing 15 posts - 1,186 through 1,200 (of 2,518 total)
  • Author
    Posts
  • in reply to: Conflict with Divi? #4852
    Vladimir
    Keymaster

    You are right. Divi theme does not register its custom post types for users.php page, so URE does not see/show them. It seems Divi code changed and related part of URE became incompatible.
    What version of Divi do you use?
    I have on hands v. 3.0.101? Is it possible to get from you a recent one for testing/investigation?

    in reply to: hide item categories for specific user role #4851
    Vladimir
    Keymaster

    Hi,

    If you write about categories selection meta box inside post editor page it’s possible to hide it from a role via “Meta boxes access” add-on. If you write about other element, show a screenshot, what do you wish to hide.

    in reply to: Copied Admin role can't edit home page #4850
    Vladimir
    Keymaster

    Static page selected as a “Home page” is available for editing by default to any user with edit_pages, edit_others_pages, edit_published_pages capabilities.
    Did you set any additional edit restrictions for this role or user with this role?

    Vladimir
    Keymaster

    Thank you for this information. This bug is fixed in version 4.46. It was published today.

    Vladimir
    Keymaster

    Hi,

    Edit file edit_mega_menu_walker.php, insert

    
    do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args );
    

    at the line #467, just after the ‘description’ field paragraph, like this:

    
    <p class="field-move hide-if-no-js description description-wide">
    ...
    </p>
    <?php
      do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args );
    ?>
    

    I hope it will help. In case of failure, I will need access to a full theme copy, to make own tests.

    in reply to: Default role settings for new sites #4839
    Vladimir
    Keymaster

    Urs,

    “Network Admin->Users->User Role Editor->Update Network” makes exactly this:
    1) replicate roles from main site to all subsites;
    2) replicate selected add-ons data to all subsites.

    in reply to: Default role settings for new sites #4837
    Vladimir
    Keymaster

    Hi Urs,

    Yes, I assume that you will configure this add-on via custom code (functions.php or MU plugin) at this stage. I will add a user interface to this part later.

    Vladimir
    Keymaster

    Yes, code was modified correctly.

    Vladimir
    Keymaster

    That is you should have this code in your functions.php finally:

    
    // 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) {
       //if (!current_user_can('hetbakenbeheren' or 'jaarboekje' or 'kerkdienstplanning')) {
        $current_user = wp_get_current_user();
        if (!in_array('hetbakenbeheren', $current_user->roles) && !in_array('jaarboekje', $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;
            }
        }
            
        return $restrict_it;
    }
    
    
    Vladimir
    Keymaster

    2)
    You have to insert this line of code:

    
    add_filter('ure_restrict_edit_post_type', 'exclude_posts_from_edit_restrictions');
    

    just before

    
    function exclude_posts_from_edit_restrictions($post_type) {
    

    line in order this post types exclusion works. It does not work at all currently.

    Let me know the result.

    Vladimir
    Keymaster

    Got it.
    Check your child theme functions.php file.

    1)
    Line #174 will never work:

    
       if (!current_user_can('hetbakenbeheren' or 'jaarboekje' or 'kerkdienstplanning')) {
    

    as such role this expression “‘hetbakenbeheren’ or ‘jaarboekje’ or ‘kerkdienstplanning'” is evaluated to a boolean result, but current_user_can() function wait that its argument will be a string with a role ID.
    You have to use this code:

    
    function show_full_list_of_attachments($show_all) {
       //if (!current_user_can('hetbakenbeheren' or 'jaarboekje' or 'kerkdienstplanning')) {
        $current_user = wp_get_current_user();
        if (!in_array('hetbakenbeheren', $current_user->roles) && !in_array('jaarboekje', $current_user->roles) && 
            !in_array('kerkdienstplanning', $current_user->roles)) {
         return $show_all;
       }
     
       return true;
    }
    

    In order users with one of those 3 roles see full list of attachments, but any other restricted user will still see just his own attachments in the Media Library.

    Vladimir
    Keymaster

    Hi,

    Try this variant:

    
    /**
     * Redirect to the home page all users except administrator after successful login.
     *
     * @param string $redirect_to URL to redirect to.
     * @param string $request URL the user is coming from.
     * @param object $user Logged user's data.
     * @return string
     */
    
    function my_login_redirect( $redirect_to, $request, $user ) {
        //is there a user to check?
        if (isset($user->roles) && is_array($user->roles)) {
            //check for subscribers
            if (!in_array('administrator', $user->roles)) {
                // redirect them to another URL, in this case, the homepage 
                $redirect_to =  home_url();
            }
        }
    
        return $redirect_to;
    }
    
    add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );
    
    in reply to: Permission issue with single user #4821
    Vladimir
    Keymaster

    Hi,

    I can look on this issue at your site if you send admin credentials and this problematic user name to support [at-sign] role-editor.com

    Vladimir
    Keymaster

    Can you provide me access to this site database and theme+plugins files copy (via DropBox or similar)?
    I will setup a copy of your site at my local development environment and check what is going wrong.

    Or just provide me admin access to your site or its stage/development copy and I will get needed files/data myself (support [at-sign] role-editor.com).

    Vladimir
    Keymaster

    Hi Arie,

    Multiple functions on the same filter returns different results for the same custom post type as filter function does not take a result of a previously called code.

    I recommend to use a single function for this filter with a logic for all you cases. Try this variant:

    
    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;
            }
        }
            
        return $restrict_it;
    }
    

    It does not restrict ‘event’ and ‘ctc_event’ CPT for a user who has both ‘hetbakenbeheren’ and ‘kerkdienstplanning’ roles at the same time.
    It does not restrict ‘ctc_sermon’ CPT if user has ‘dominee’ role.

Viewing 15 posts - 1,186 through 1,200 (of 2,518 total)