• Resolved mikedrum155

    (@mikedrum155)


    Hi,
    I can’t see an option and it doesn’t seem to be a pro feature either, just wondering if there’s a way to hide certain tabs unless you’re logged in?
    For example a tab called “Extra Info” which is hidden from visitors, but if you’re logged in the tab will display.
    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @mikedrum155,

    That functionality is not an option in the plugin, but can be added fairly easily in your functions.php file.

    Something like this should do the trick:

    add_filter(
    	'yikes_woo_filter_all_product_tabs',
    	function( $tabs ) {
    		if ( ! is_user_logged_in() ) {
    			unset( $tabs['tab-name'] );
    		}
    		return $tabs;
    	}
    );

    Hope this helps!

    Thanks,
    Jon

    Thread Starter mikedrum155

    (@mikedrum155)

    Hi,

    Thank you for the response, and sorry for my late one, this didn’t seem to do anything though? No option was added on the product edit page, and when logged out could still see custom tabs.

    Help much appreciated thank you

    Hi @mikedrum155,

    No worries. The snippet above doesn’t do anything to the product edit page, it just removes a tab from the list if the visitor is not logged in.

    Did you make sure to change the bit that says “tab-name” to the name of your tab? I would guess it’s something like “extra-info”.

    Thanks,
    Jon

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Tabs for logged in users only?’ is closed to new replies.