Dashboard no downloads

Home » Snippets » Dashboard no downloads
0

Created with:

WooCommerce Account Page Tabs Generator

Visibility: 

public

Creator: Lourens

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project
				/**
 * Remove payment methods and orders links in WooCommerce account menu
 *
 * @param array $menu_links The account menu links
 *
 * @return array The modified account menu links without payment methods and orders
 */
function wpturbo_remove_woocommerce_account_links( array $menu_links ): array {
	unset( $menu_links['downloads'] );
	return $menu_links;
}
add_filter( 'woocommerce_account_menu_items', 'wpturbo_remove_woocommerce_account_links' );

/**
 * Add custom endpoint for custom tab in WooCommerce account page
 * 
 * @return void
 */
function wpturbo_add_custom_tab_endpoint() : void {
	add_rewrite_endpoint( 'wpturbo-custom-tab', EP_PAGES );
}
add_action( 'init', 'wpturbo_add_custom_tab_endpoint' );

/**
 * Render the content of the custom tab
 * 
 * @return void
 */
function wpturbo_render_my_custom_tab_wpturbo_custom_tab_endpoint() : void {
	// The code to render wpturbo-custom-tab () custom tab content goes here
}
add_action( 'woocommerce_account_wpturbo-custom-tab_endpoint', 'wpturbo_render_my_custom_tab_wpturbo_custom_tab_endpoint' );

			

NDB

Register an account to save your snippets or go Pro to get more features.