Change WordPress user roles and capabilities Forums How to or FAQ Allow WooCom Order Filtering, w/out Posts Admin Menu Access Reply To: Allow WooCom Order Filtering, w/out Posts Admin Menu Access

#2795
Vladimir
Keymaster

Hi,

Thanks for paying my attention on this problem.

It depends from what filter you will use (may be use have some custom filters).
In order to allow WC to use a filter by customer wee need to mark as ‘allowed’ the ‘_customer_user’ URL parameter, like this:


add_filter('ure_admin_menu_access_allowed_args', 'allow_events_filter', 10, 1);
 
function allow_events_filter($args) {
 
    $args['edit.php'][''][] = '_customer_user';
 
    return $args;
 
}

I will add the support for this argument directly to User Role Editor Pro with the next update.

In general ‘edit_posts’ capability is not required to allow work with WC Orders. This custom post type has its own set of user capabilities – ends with ‘_shop_orders’.
WooCommerce does not allow access to backend to any user without ‘manage_woocommerce’ or ‘edit_posts’ capability. But there is a workaround for this.
So you will not need to block access to “Posts” menu it this case.