• Resolved valesilve

    (@valesilve)


    Hi,

    first of all, thank you for your great work!

    I have only a question: I would like to show “custom product tab” item menu of WordPress admin panel, to users with Shop manager role, to allow theme to add, edit or delete custom tabs. Now, I can show it only to administrator.

    Is there a way to do it?

    Great regards,

    v.

    • This topic was modified 7 years ago by valesilve.
Viewing 5 replies - 1 through 5 (of 5 total)
  • @valesilve

    Great question. Shop manager role should be allow to FULLY manage the shop.
    I’m voting for that one for sure :))

    Cheers

    Plugin Contributor Tracy Levesque

    (@liljimmi)

    ?????? YIKES, Inc. Co-Owner

    Hello,

    This is a really great idea. Thank you for bringing it to our attention.
    I will definitely add it to the to-do list.

    -Tracy

    Great news and Thank you !!!!

    Thread Starter valesilve

    (@valesilve)

    Thank you Tracy,

    happy to contribute!

    v.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hello @fcpro and @valesilve,

    You can control the capability required to manage saved tabs via a filter function.

    With the way WordPress menu pages work, you should specify a capability (rather than a role) for viewing pages. To allow Shop Managers and Administrators to view Custom Product Tabs pages, I used the publish_products role.

    This is the code needed:

    /** Allow any user with the 'publish_products' capability to view Custom Product Tabs pages **/
    add_filter( 'yikes-woo-settings-menu-capability', 'allow_shop_managers_to_custom_product_tabs', 10, 1 );
    add_filter( 'yikes-woo-support-capability', 'allow_shop_managers_to_custom_product_tabs', 10, 1 );
    add_filter( 'yikes-woo-premium-capability', 'allow_shop_managers_to_custom_product_tabs', 10, 1 );
    
    function allow_shop_managers_to_custom_product_tabs( $cap ) {
    	return 'publish_products';
    }

    Let me know if you need any help adding this custom code.

    All the best,
    Kevin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom product tabs for shop manager role’ is closed to new replies.