• Resolved quark81

    (@quark81)


    How do we enable access for Shop Admin user role in the wp administration?

    We are using User Role Editor, but can’t see specific permissions required to get Editors access to this.

    Currently, only admin users can see the configuration screens (ie /wp-admin/admin.php?page=wapf-field-groups).

Viewing 1 replies (of 1 total)
  • Plugin Author Maarten B

    (@maartenbelmans)

    Hi @quark81

    APF does not register its own capability, so there is nothing for User Role Editor to tick. By default it uses manage_options (a standard WP role), which is why only admins see the screen.

    You can change that capability with a filter. Add this to your theme’s functions.php file or a code snippets plugin:

    add_filter( 'wapf/setting/capability', function() {
        return 'manage_woocommerce';
    } );
    

    After that, give the Editor role the manage_woocommerce capability in User Role Editor and they will get access to the field groups screen (menu item, editing, saving, deleting).

    If you prefer not to give Editors the full WooCommerce capability, use a dedicated one instead:

    add_filter( 'wapf/setting/capability', function() {
        return 'wapf_manage_fields';
    } );
    

    Then add wapf_manage_fields as a new capability in User Role Editor and assign it to the roles you want.

    One thing to keep in mind: the APF screen sits under the WooCommerce menu. If a role can not see the WooCommerce menu at all, the submenu item stays hidden.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.