0
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( 'srhdesign-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_srhdesign_custom_tab_endpoint() : void {
// The code to render srhdesign-custom-tab () custom tab content goes here
}
add_action( 'woocommerce_account_srhdesign-custom-tab_endpoint', 'wpturbo_render_my_custom_tab_srhdesign_custom_tab_endpoint' );