简体   繁体   中英

How to remove "Paypal payments" tab from My Account in Woocommerce

The Woocommerce Paypal Payments plugin adds a "Paypal payments" tab on the Woocommerce My Account page. How do I remove this tab entirely?

I have tried this snippet modified from one found here but was unsuccessful in removing the tab.

add_filter ( 'woocommerce_account_menu_items', 'misha_remove_my_account_links' );
function misha_remove_my_account_links( $menu_links ){
        
  unset( $menu_links['ppcp-paypal-payment-tokens'] );
        
  return $menu_links;
        
}

You're on the right track! That plugin adds that tab on priority of 40 . So, you could add a filter on a higher priority, let's say 50 , like this:

add_filter('woocommerce_account_menu_items', 'misha_remove_my_account_links', 50);

function misha_remove_my_account_links($menu_links)
{

    unset($menu_links['ppcp-paypal-payment-tokens']);

    return $menu_links;
}

And poof! That extra tab is gone!

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM