Forum Replies Created

Viewing 15 posts - 1,396 through 1,410 (of 2,529 total)
  • Author
    Posts
  • in reply to: Edit selected posts #4294
    Vladimir
    Keymaster

    This article is still up to date. Look at it as documentation page. Yes, it was written some months ago, but it describes a working feature, may be except of some minor changes.

    Can this user edit posts or pages? “Posts/Pages/Custom Post Types Editor Restrictions” section is shown is a user profile page only for users who can edit posts or pages. Settings from this section does not bring to a user any new permissions. All it is about to restrict the existing editing access, narrow down it.

    You will not see this section at user profile, if a user has ‘administrator’ role. There is no sense to restrict site super administrator.

    in reply to: Protecting specific page from being edited #4288
    Vladimir
    Keymaster

    I followed this article always.
    And selected “Subdirectories — a path-based network in which on-demand sites use paths” to not struggle configuring Apache with subdomains.

    in reply to: Protecting specific page from being edited #4285
    Vladimir
    Keymaster

    Look how it works at my test site – demo video.

    Slightly enhanced code version. Update your copy:

    
    add_filter('ure_edit_posts_access_id_list', 'ure_edit_posts_access_set_id_list');
    
    function ure_edit_posts_access_set_id_list($list) {
        if (!current_user_can('edit_others_pages')) {
            return $list;
        }
        
        $slugs = array('shop', 'busket');   // input blocked pages slug here
        $id_list = array();
        foreach($slugs as $slug) {
            $page = get_page_by_path($slug);
            if (!empty($page)) {
                $id_list[] = $page->ID;
            }
        }
        if (count($id_list)>0) {
            $id_list_str = implode(',', $id_list);
            $list .= $id_list_str;
        }
    
        return $list;
    }
    
    add_filter('ure_edit_posts_access_restriction_type', 'ure_edit_posts_access_set_restriction_type');
    
    function ure_edit_posts_access_set_restriction_type($restriction_type) {
        if (current_user_can('edit_others_pages')) {
            $restriction_type = 2; // Block
        }
        
        return $restriction_type;
    }
    
    in reply to: 2nd personal license needed #4283
    Vladimir
    Keymaster

    Hi Chris,

    Yes, you have to create a 2nd account: open purchase page without login to the site and use another user name and email address.

    in reply to: Protecting specific page from being edited #4281
    Vladimir
    Keymaster

    This code does not depend from a page ID. It blocks edit access for pages with ‘shop’ and ‘busket’ slugs for any user with ‘edit_others_pages’ capability for any subsite.

    
    add_filter('ure_edit_posts_access_id_list', 'ure_edit_posts_access_set_id_list');
    
    function ure_edit_posts_access_set_id_list($list) {
        $current_user = wp_get_current_user();
        $lib = URE_Lib_Pro::get_instance(); 
        if (!current_user_can('edit_others_pages')) {
            return $list;
        }
        
        $slugs = array('shop', 'busket');
        $id_list = array();
        foreach($slugs as $slug) {
            $page = get_page_by_path($slug);
            if (!empty($page)) {
                $id_list[] = $page->ID;
            }
        }
        $id_list_str = implode(',', $id_list);
        $list .= $id_list_str;
    
        return $list;
    }
    
    add_filter('ure_edit_posts_access_restriction_type', 'ure_edit_posts_access_set_restriction_type');
    
    function ure_edit_posts_access_set_restriction_type($restriction_type) {
        $current_user = wp_get_current_user();
        $lib = URE_Lib_Pro::get_instance(); 
        if (current_user_can('edit_others_pages')) {
            $restriction_type = 2; // Block
        }
        
        return $restriction_type;
    }
    

    If you will wish to add some edit restriction for user with ‘edit_others_pages’ manually, you should take into account that this restricton should be the same type “Block” in order to not break this code and vice versa.

    in reply to: Protecting specific page from being edited #4279
    Vladimir
    Keymaster

    Give me more details. Does it one page for a subsite?
    Show a list of pages with ID and permalinks (without domain) and describe conditions, how will you decide what permalink for what site to select.

    in reply to: Protecting specific page from being edited #4276
    Vladimir
    Keymaster

    It possible to extend a logic of the ‘set_id_list’ function using WP function url_to_postid(), in order to return a page ID related to current site.

    in reply to: Hide/Disable Tools > Scheduled Actions #4275
    Vladimir
    Keymaster

    Try to deactivate and activate back User Role Editor Pro.

    in reply to: Hide/Disable Tools > Scheduled Actions #4274
    Vladimir
    Keymaster

    I got it. Thanks. It’s really comes from “WC Subscriptions” plugin. But I have another picture at my test. Menu items is protected by ‘edit_posts’ capability and it’s available for blocking at ‘Admin menu’:
    Scheduled Actions in admin menu for editor

    in reply to: Protecting specific page from being edited #4272
    Vladimir
    Keymaster

    This screenshot belongs to other add-on: Content view restrictions, which works for front-end.

    I recommended to use another one. If you provide that those restricted pages will have the same IDs at any subsite of your network, you can setup the list of restricted pages, like “1, 3, 7” via custom filters ‘ure_edit_posts_access_id_list’ and ‘ure_edit_posts_access_restriction_type’ as a must use plugin – which will work for any subsite.

    
    add_filter('ure_edit_posts_access_id_list', 'ure_edit_posts_access_set_id_list');
    
    function ure_edit_posts_access_set_id_list($list) {
        $current_user = wp_get_current_user();
        $lib = URE_Lib_Pro::get_instance(); 
        if ($lib->user_can_role($current_user, 'editor')) {
            $list .= ',1,3,7';
        }
    
        return $list;
    }
    
    add_filter('ure_edit_posts_access_restriction_type', 'ure_edit_posts_access_set_restriction_type');
    
    function ure_edit_posts_access_set_restriction_type($restriction_type) {
        $current_user = wp_get_current_user();
        $lib = URE_Lib_Pro::get_instance(); 
        if ($lib->user_can_role($current_user, 'editor')) {
            $restriction_type = 2; // Block
        }
        
        return $restriction_type;
    }
    
    in reply to: Hide/Disable Tools > Scheduled Actions #4270
    Vladimir
    Keymaster

    OK. Can you share “WC Subscriptions” plugin copy with me (support [at-sign] role-editor.com) via Dropbox, Google Drive or similar?
    I will investigate this in my local test environment then.

    in reply to: Protecting specific page from being edited #4267
    Vladimir
    Keymaster

    Hi,

    You can achieve this with Edit access restrictions add-on. You can prohibit with it the editing of a list of pages by ID for the editor role.

    in reply to: Hide/Disable Tools > Scheduled Actions #4266
    Vladimir
    Keymaster

    Hi,

    Did you looked at “Admin menu” under “Administrator” role? You have to look “Admin menu” under role which has required capability to see needed menu item.

    I don’t have this menu item with active WooCommerce. I suppose it was added by some other plugin or by WC add-on.

    in reply to: Woocommerce add order #4263
    Vladimir
    Keymaster

    It seems a subject for enhancement. You can see ‘create_shop_coupons’ capability under “Custom post types->Coupons”, but you don’t see it under “Custom capabilities->Woocommerce->Coupons”, right? I will update a list of capabilities related to WooCommerce.

    in reply to: 2 users with same roles can't access same content #4259
    Vladimir
    Keymaster

    Hi,

    Problem is not related to the content access. It caused by JavaScript error from jQuery. It takes place for the demo user and does not for admin.
    Content is shown usually by jQuery effect during page scrolling. But page for demo user has JavaScript errors, which prevents this effect execution, as I suppose. So a problem is related to a theme.

    I changed a role for demo user to subscriber temporally. Content (product description) was visible.

    So there is an issue with a page for user with ‘administrator’ role but the username other than ‘admin’, which cause a JavaScript error.

    This JavaScript error takes place even with User Role Editor Pro deactivated.

Viewing 15 posts - 1,396 through 1,410 (of 2,529 total)