Forum Replies Created

Viewing 15 posts - 1,846 through 1,860 (of 2,506 total)
  • Author
    Posts
  • Vladimir
    Keymaster

    Thanks for this information. I fixed mistake in the updates server script. Please try to update again.

    in reply to: WooImporter #2753
    Vladimir
    Keymaster

    WooImporter uses ‘manage_options’ capability to protect its menu items. Try this variant:
    1) add ‘manage_options’ to your VA role and
    2) use Admin Menu Access add-on to block for that role “Settings” menu and any other menus which also are protected by the “manage_options” capability.

    in reply to: WooImporter #2751
    Vladimir
    Keymaster

    I need a WooImporter plugin copy to look to its code. Sometimes developers allows to replace needed capability for plugin menu on the fly. You may send a .zip or a link to it to support [at-sign] role-editor.com

    in reply to: Editor Role adding access to Menu and Widgets #2749
    Vladimir
    Keymaster

    Add “edit_theme_options” capability to the “editor” role:
    1) Open “Users->User Role Editor”, select “Editor” role.
    2) Turn ON checkbox for the “edit_theme_options” capability, click “Update”.

    After that user with “Editor” role will receive access to the full “Appearance” menu, as all its submenu items are protected by the same “edit_theme_options” capability.
    If you wish to allow to the ‘editor’ role to work just with “Menu” and “Widgets” items of the “Appearance” menu, you need to block other items with “Admin Menu Access” add-on.

    Vladimir
    Keymaster

    I will publish stable Pro version 4.28.2 tomorrow.

    in reply to: Restrict Access to Custom Taxonomies #2743
    Vladimir
    Keymaster

    Currently I can not recommend another workaround then that you use already.
    But it’s a good point to extend User Role Editor Pro functionality. I will think on it. May be something similar to the “force custom taxonomies to use own capabilities” option will be possible to add. I will post here as I will find a decision.

    Vladimir
    Keymaster

    Hi,

    Try this recipe:

    
    add_action('admin_init', 'remove_product_editor');
    function remove_product_editor() {
    
      if (current_user_can('product-meta-editor')) {
        remove_post_type_support('product', 'editor');
      }
      
    }
    

    Replace role ID ‘product-meta-editor’ with your own as ‘sales-manager’. Add this code to the active theme functions.php file or setup it as a must use plugin.

    in reply to: "Activate Administrator Menu Access module" bug #2738
    Vladimir
    Keymaster

    Hi Urs,

    Thanks for your help in finding this.
    “Admin menu access” add-on works with this rule: if something is not directly allowed – it’s prohibited. I extended the list of allowed arguments for the ‘edit.php’ command to fix the issues your noted. Try development version 4.28.2.b8. It’s available after login from the download page as always.

    Vladimir
    Keymaster

    You have to call current_user_can() for every role you wish to check, e.g.:

    
    if (current_user_can('role_1') || current_user_can('role_2')) {
      ...
    }
    

    This means “if current user have role_1 or current user have role_2”.

    For our code:

    
    if (!current_user_can('sales') && !current_user_can('shipping')) {
        return;
    }
    

    That is ‘do not execute code below if user does not have role ‘sales’ and user does not have role ‘shipping’.

    Vladimir
    Keymaster

    Thanks for the clarification. I missed ‘Order status’ field yesterday. Try this version. It removes dropdown list of statuses if order was refunded already and just shows “Refunded” text and removes ‘Refunded’ item from the dropdown list options in other cases:

    
    add_action('admin_head', 'hide_wc_refund_button');
    
    function hide_wc_refund_button() {
    
        global $post;
    
        if (!current_user_can('sales')) {
            return;
        }
        if (strpos($_SERVER['REQUEST_URI'], 'post.php?post=') === false) {
            return;
        }
    
        if (empty($post) || $post->post_type != 'shop_order') {
            return;
        }
    ?>
        <script>
          jQuery(function () {
                jQuery('.refund-items').hide();
                jQuery('.order_actions option[value=send_email_customer_refunded_order]').remove();
                if (jQuery('#original_post_status').val()=='wc-refunded') {
                    jQuery('#s2id_order_status').html('Refunded');
                } else {
                    jQuery('#order_status option[value=wc-refunded]').remove();
                }
            });
        </script>
        <?php
    
    }
    
    Vladimir
    Keymaster

    Try this updated version:

    
    add_action('admin_head', 'hide_wc_refund_button');
    
    function hide_wc_refund_button() {
    
        global $post;
    
        if (!current_user_can('sales')) {
            return;
        }
        if (strpos($_SERVER['REQUEST_URI'], 'post.php?post=') === false) {
            return;
        }
    
        if (empty($post) || $post->post_type != 'shop_order') {
            return;
        }
    ?>
        <script>
          jQuery(function () {
                jQuery('.refund-items').hide();
                jQuery('.order_actions option[value=send_email_customer_refunded_order]').remove();
            });
        </script>
        <?php
    
    }
    
    Vladimir
    Keymaster

    Hi,

    The only way to hide “Refunds” button from order edit form is to change HTML page CSS via JavaScript. Add code below to the active theme functions.php file or setup it as a must-use plugin. It is executed for the ‘orders-manager’ role only. Replace it with you own role ID.

    
    add_action('admin_head', 'hide_wc_refund_button');
    
    function hide_wc_refund_button() {
    
        global $post;
    
        if (!current_user_can('orders-manager')) {
            return;
        }
        if (strpos($_SERVER['REQUEST_URI'], 'post.php?post=') === false) {
            return;
        }
    
        if (empty($post) || $post->post_type != 'shop_order') {
            return;
        }
    ?>
        <script>
          jQuery().ready(function () {
                jQuery('.refund-items').hide();
            });
        </script>
        <?php
    
    }
    
    Vladimir
    Keymaster

    Hi,

    Yes, it’s possible. Input ‘Authors user ID’ list for the teacher instead of posts ID list. Use “with author user ID (comma separated)” field for that.

    in reply to: Visual Composer problems #2724
    Vladimir
    Keymaster

    Hi,

    Thanks for letting me know.

    in reply to: Screen Options #2719
    Vladimir
    Keymaster

    Hi,
    It could be suitable for admin to manage it this way. Thanks for the right direction.

Viewing 15 posts - 1,846 through 1,860 (of 2,506 total)