• Resolved rick131pol

    (@rick131pol)


    Hi, how can you hide a tab using unset( $tabs[‘custom_tab’] ); My snippet code is:

    add_filter( 'woocommerce_product_tabs', 'remove_product_tabs', 98 );
    function remove_product_tabs( $tabs ) { 
    if ( ! is_user_logged_in() ) {
    unset( $tabs['custom_download'] );      	// unset( $tabs['description'] );
    }
    return $tabs;
    }

    Unfortunately the code doesn’t work in any way. I absolutely need to have one tab visible only to logged in users. So far I have created the ACF field and it works, but I would like to have all the tabs in one place. custom tab is title my tab for example ‘downloads’. The plugin is great. Please Help.

Viewing 1 replies (of 1 total)
  • Plugin Support Barn2 Plugin Support

    (@barn2pluginsupport)

    Hi, @rick131pol.

    Thanks for getting in touch and for using WooCommerce Product Tabs.

    While we don’t have any immediate plans to implement this, a few other customers have previously requested an option to restrict/show tabs to logged in users, and we’re tracking the amount of demand to help us decide whether to prioritize it in the future.?

    I have added your ‘vote’ to our feature request list, and we will let you know if we add this to a future version of the plugin.?

    In the meantime, I’m sorry that this isn’t possible and hope you’ll understand that what you’d like to achieve is a customization and is beyond the scope of our support.

    While we try to be as helpful as possible, we simply can’t allocate too many resources for customization and all I can do is to apologize for this inconvenience and hope that you understand.

    Please let me know if there’s anything else that we may assist you with.

    Many thanks,
    Edge

Viewing 1 replies (of 1 total)
  • The topic ‘Hide a tab using unset( $tabs[‘custom_tab’] );’ is closed to new replies.