Last active
November 28, 2024 10:30
-
-
Save maddisondesigns/92de884d8f7e3449dee86c414db48cf0 to your computer and use it in GitHub Desktop.
Remove the WooCommerce Payments top-level menu item
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* In WooCommerce 9.4.1 a new Payments menu item was introduced. For most users, this caused a blank page to be displayed when clicked. | |
* In WooCommerce 9.4.2 it was fixed so that it no longer shows a blank page, but instead, redirects you to the Payments tab in the WooCommerce Settings. | |
* When you're not using the WooCommerce Payments Payment Gateway, this menu is completely irrelevant and just adds to the existing clutter | |
* that WooCommerce already adds into your Dashboard! | |
*/ | |
function mytheme_remove_payments_menu() { | |
remove_menu_page( 'admin.php?page=wc-settings&tab=checkout' ); | |
} | |
add_action( 'admin_init', 'mytheme_remove_payments_menu' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment