Forum Replies Created

Viewing 15 posts - 1,816 through 1,830 (of 2,513 total)
  • Author
    Posts
  • in reply to: Default WordPress Filters #2842
    Vladimir
    Keymaster

    Hi Kevin,

    Such problem may appear when you use “Admin Menu Access” add-on to block some menu items. URE thinks that URL with unknown parameters like ‘comment_status’ are prohibited. There is a workaround for this.

    Show me the screenshots what settings you made with “Admin Menu” for the role which is redirected to dashboard when you try to use filtering tabs at the Comments page. I will try to reproduce your situation and recommend a solution.

    Vladimir
    Keymaster

    Try this variant. I removed the “Account Details” from the left menu items too, as it’s the only available my account endpoint and it’s not sense to place the link on the same page.

    
    add_filter('woocommerce_account_menu_items', 'filter_wc_my_account_menu');
    add_action('template_redirect', 'redirect_for_blocked_wc_pages');
    
    function filter_wc_my_account_menu($items) {
        if (!current_user_can('subscriber')) {
            return $items;
        }
        if (isset($items['dashboard'])) {
            unset($items['dashboard']);
        }
        if (isset($items['orders'])) {
            unset($items['orders']);
        }
        if (isset($items['downloads'])) {
            unset($items['downloads']);
        }
        if (isset($items['edit-address'])) {
            unset($items['edit-address']);
        }
        if (isset($items['edit-account'])) {
            unset($items['edit-account']);
        }
        if (isset($items['payment-methods'])) {
            unset($items['payment-methods']);
        }
    
        return $items;
    }
    
    function redirect_from_blocked_url() {
        $my_account_url = wc_get_endpoint_url('edit-account');
        wp_redirect($my_account_url);
        die;    
    }
    
    function check_end_point_url($end_point, $current_url) {
        $blocked_url = wc_get_endpoint_url($end_point);
        if ($current_url==$blocked_url) {
            redirect_from_blocked_url();
        }
    }
    
    function redirect_for_blocked_wc_pages() {
        global $wp, $wp_query;
               
        if (!current_user_can('subscriber')) {
            return;
        }
        
        if (is_account_page() && !is_wc_endpoint_url()) {
            // block Woo My Account Dashboard;
            redirect_from_blocked_url();
        }
                
        $current_url = trailingslashit(home_url($wp->request));
        $blocked_end_points = array('dashboard', 'orders', 'downloads', 'edit-address', 'payment-methods');
        foreach($blocked_end_points as $bep) {
            check_end_point_url($bep, $current_url);
        }
        
    }
    
    in reply to: Where is the capability to close session? #2837
    Vladimir
    Keymaster

    Resolved (discussed via email).
    Update was included into the development version 4.29.

    Vladimir
    Keymaster

    Thanks for the feedback. I will look if it’s possible to change the default page for “My Account”.

    in reply to: Where is the capability to close session? #2834
    Vladimir
    Keymaster

    Got it. Thanks. I will contact you with a solution in 1-2 days.

    in reply to: Where is the capability to close session? #2832
    Vladimir
    Keymaster

    Right. Send that URL to support [at-sign] role-editor.com. I need to see a full structure to take a solution how to resolve this issue.

    in reply to: Where is the capability to close session? #2830
    Vladimir
    Keymaster

    So there is no ‘wp-login.php’ in the logout URL?

    in reply to: Where is the capability to close session? #2827
    Vladimir
    Keymaster

    Yes, it’s exactly that what I asks to show. Thanks.

    I still can not reproduce the issue though.
    Could you check and show me the link from your site for the ‘Log Out’ menu item at top right corner. I suppose the only case when it could be removed by URE Pro – when it was modified somehow from the default value: wp-login.php?action=logout&_wpnonce=…

    in reply to: Cannot load woocommerce #2825
    Vladimir
    Keymaster

    Hi,

    All these WooCommerce Settings page tabs a linked to the URL like
    admin.php?page=wc-settings&tab=
    I do not see page=woocommerce anywhere. WordPress can not find such resource registered and shows the error message ‘can not load …’.

    Try to find why you have the wrong links at these tabs.

    Vladimir
    Keymaster

    Hi,

    Try to install this code as a “must use” plugin. Replace ‘subscriber’ role inside to you own role ID, e.g. ‘candidate’:

    
    add_filter('woocommerce_account_menu_items', 'filter_wc_my_account_menu');
    add_action('template_redirect', 'redirect_for_blocked_wc_pages');
    
    function filter_wc_my_account_menu($items) {
        if (!current_user_can('subscriber')) {
            return $items;
        }
        if (isset($items['dashboard'])) {
            unset($items['dashboard']);
        }
        if (isset($items['orders'])) {
            unset($items['orders']);
        }
        if (isset($items['downloads'])) {
            unset($items['downloads']);
        }
        if (isset($items['edit-address'])) {
            unset($items['edit-address']);
        }
        if (isset($items['payment-methods'])) {
            unset($items['payment-methods']);
        }
    
        return $items;
    }
    
    function check_end_point_url($end_point, $current_url) {
        $blocked_url = wc_get_endpoint_url($end_point);
        if ($current_url==$blocked_url) {
            $my_account_url = wc_get_endpoint_url('woo-account-page');
            wp_redirect($my_account_url);
            die;
        }
    }
    
    function redirect_for_blocked_wc_pages() {
        global $wp;
        
        if (!current_user_can('subscriber')) {
            return;
        }
            
        $current_url = trailingslashit(home_url($wp->request));        
        $blocked_end_points = array('dashboard', 'orders', 'downloads', 'edit-address', 'payment-methods');
        foreach($blocked_end_points as $bep) {
            check_end_point_url($bep, $current_url);
        }
        
    }
    
    in reply to: Where is the capability to close session? #2815
    Vladimir
    Keymaster

    Not yet, I just see that a reason of this problem in URE “admin menu access” module. I need to reproduce this problem to start searching a solution.
    Show a screenshot of “Admin menu access” dialog window for the problematic role. I will try to make the same settings.

    in reply to: Where is the capability to close session? #2813
    Vladimir
    Keymaster

    That’s strange. Please test if ‘Logout’ link will be available if you deactivate (temporary) “Admin menu access” add-on. Will it be shown?

    in reply to: Shared Media Files #2810
    Vladimir
    Keymaster

    Media Library items are protected by the same capabilities as the posts and should be available for view without any limits. The list Media items is restricted if you set the edit restrictions for the role or the user. Is it your case?

    It’s not possible currently to restrict role to edit just items created by users with the same role. But it’s a good enhancement to add in a future.
    The nearest feature is to list all users ID from that role as the allowed list of authors for this role posts edit restrictions at the “with author user ID” field.

    This workaround may not be applicable though if you do not plan to give the ‘edit_others_posts’ capability to this role. A limited read only access to the list of Media library items is not realized.

    in reply to: Where is the capability to close session? #2809
    Vladimir
    Keymaster

    Hi Luis,

    Default menu at the top right corner under current user name is:
    – Edit My Profile;
    – Log Out.

    Are they available? Or full admin menu bar was not available for this user.

    Is ‘Close Session’ button available to the built-in subscriber role?
    Check the plugin which adds ‘Close Session’ button. May be it has an option to show such button for the selected roles only, etc.

    in reply to: Suscriber control panel quit menu options #2805
    Vladimir
    Keymaster

    You are at 1 step from the needed solution:
    – Revoke capabilities you gave directly to colegioinfantil user.
    – Grant him the same capabilities via role at that site. You may create a new role as a copy of the subscriber role and add edit posts capabilities set to it.
    – After that open “Admin menu” for that role: you will see all available menu items from yesterday screenshot and may select unneeded menu items to block them.

Viewing 15 posts - 1,816 through 1,830 (of 2,513 total)