• Resolved Jason Wong

    (@eljkmw)


    G’day Tim,

    How do I allow certain roles access to Loco Translate via the admin end. So far, I noticed only Administrator role is given access. I’m using the WooCommerce plugin, which provides additional roles like “Shop Manager” and “Customer”. I too have removed all of WP’s core roles except for Administrator.

    Will I need to use any additional plugin, such as Capability Manager Enhanced to probably merge WooCommerce’s and WP’s capabilities? I wish to avoid adding more plugins into my website, if that’s possible.

    Please advise. Thank you in advance.

    https://www.ads-software.com/plugins/loco-translate/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tim W

    (@timwhitlock)

    In version 1 – It’s not the role, it’s the capability. Anyone with the manage_options capability has access. This can also be filtered by loco_admin_capability

    In version 2 – this is built into the settings and there is no filter.

    Thread Starter Jason Wong

    (@eljkmw)

    Thanks, Tim. I’ve added the “manage_options” capability to WooCommerce’s “Shop Manager” role in my active theme’s functions.php, and it worked.

    function add_role_caps() {
        // check if WooCommerce plugin exists
        if (class_exists( 'WooCommerce' ) ) {
            // gets the Shop Manager role
            $role = get_role( 'shop_manager' );
    
            // allow shop manager to manage options
            $role->add_cap( 'manage_options' );
        }
    }
    add_action( 'admin_init', 'add_role_caps' );

    How do you get it filtered by loco_manage_capability?

    Plugin Author Tim W

    (@timwhitlock)

    Thread Starter Jason Wong

    (@eljkmw)

    Many thanks, Tim. (^_^)v

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Role permissions’ is closed to new replies.