• Resolved stepheniryna

    (@stepheniryna)


    I used two of your code snippets, but they conflict and I need them to be combined.

    The first is code for removing privacy and notifications tabs from the user profile.

    The second is the snippet for adding a new tab in the user account page.

    Snippets plugin wont let me use both at same time, in different snippets, because it calls the same function twice. Please help by making them one snippet.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi,

    Can you please paste the code here or create a support ticket on https://userswp.io/support?

    Regards,
    Patrik

    Please provide solution afterwards here, as I wish to do same…

    Hi,

    Following is the code for removing invoices, subscriptions, billing address, notifications, privacy menus from the account tab:

    add_filter('uwp_account_available_tabs', 'uwp_account_available_tabs_cb');
    function uwp_account_available_tabs_cb($tabs){
    	unset($tabs['gp-invoices']);
    	unset($tabs['gp-subscriptions']);
    	unset($tabs['gp-edit-address']);
    	unset($tabs['notifications']);    
    	unset($tabs['privacy']);
    	return $tabs;
    }

    Please remove/modify your previous code related to this if you have. You can remove the line from the code if you want to show any tab from the list.

    Regards,
    Patrik

    And within uwp_account_available_tabs_cb() I can unset and register new tabs at the same time, right?

    Yes! But you will need other hooks as per the doc link I shared for displaying the content of the tab and title of the tab.

    Regards,
    Patrik

    Got it. Thank you.

    Thread Starter stepheniryna

    (@stepheniryna)

    I’m the original poster here. This entire conversation between author and a third person happened before my workday started. So I’m going to send in the code like you asked me in your original reply to me.

    Hi,

    We have got your ticket and we will reply there for your issue.

    Regards,
    Patrik

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Code snippets conflict’ is closed to new replies.