• Resolved paigettie

    (@paigettie)


    Read through the forum and found a couple of posts that seemed to fit my need. applies this code (given in each of the replies) to the functions.php. Unfortunately I can still see SRP tab and info even though I’m in not logged in or in incognito mode. Am I missing something or does this code no longer work? Thanks in advance! So appreciated!

    add_filter(
    ‘yikes_woo_filter_all_product_tabs’,
    function( $tabs ) {
    if ( ! is_user_logged_in() ) {
    unset( $tabs[‘SRP’] );
    }
    return $tabs;
    }
    );

    The page I need help with: [log in to see the link]

Viewing 2 replies - 16 through 17 (of 17 total)
  • Thread Starter paigettie

    (@paigettie)

    Okay, this is what I put in the functions.php and I’m getting it to work consistently. I’m having my client test it on his end. Fingers crossed! I think it’s finally done! I’m waiting to mark as “resolved” for client confirmation. =)

    add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
    function woo_remove_product_tabs( $tabs ) { 
    if ( ! is_user_logged_in() ) {
    unset( $tabs['srp'] );      	// Remove the srp tab
    }
    return $tabs;
    }
    

    Hi @paigettie,

    Yes, that is correct! You figured it out 🙂 Glad I was able to help point you in the right direction.

    Let us know if you need anything else.

    Jon

Viewing 2 replies - 16 through 17 (of 17 total)

The topic ‘Hide Custom Tabs’ is closed to new replies.