Modifying Tab Names In Account Page For WooCommerce

目錄

Original Posts

Modifying Tab Names In Account Page For WooCommerce


As a default setting in WooCommerce, there are six page links in account page. These titles seem weird in some language because of the bad translation. This post will show how to customize tab tiles. All you need to do is to copy and paste to your function.php, then modify “Name” and “textdomain”.

// My Account Navigation
add_filter( 'woocommerce_account_menu_items', 'change_my_account_dashboard_name', 999 );
function change_my_account_dashboard_name( $items ) {
	$items['dashboard'] = __( 'Name1', 'textdomain' );
	$items['orders'] = __( 'Name2', 'textdomain' );
	$items['edit-address'] = __( 'Name3', 'textdomain' );
	$items['edit-account'] = __( 'Name4', 'textdomain' );
	$items['customer-logout'] = __( 'Name5', 'textdomain' );
	return $items;
}

Textdomain is used for multi-language sites. If you are a rookie for WordPress, I guess you don’t need it either. Just delete the whole “__( ‘Name1’, ‘textdomain’ )”, and change to other names, like Main.

Related Posts

The Complete WordPress Customization Tutorial – Just Copy And Paste And Work

Content Protection by DMCA.com
A
Aron

Leave a Reply

Your email address will not be published. Required fields are marked *