[英]WooCommerce My Account page custom menu item with custom link
I was able to create a new menu item " Special Page " using this:我能够使用这个创建一个新的菜单项“特殊页面”:
add_filter( 'woocommerce_account_menu_items' , 'kc_menu_panel_nav' );
function kc_menu_panel_nav() {
$items = array(
'dashboard' => __( 'Dashboard', 'woocommerce' ),
'orders' => __( 'Orders', 'woocommerce' ),
'downloads' => __( 'Downloads', 'woocommerce' ),
'edit-address' => __( 'Addresses', 'woocommerce' ),
'payment-methods' => __( 'Payment Methods', 'woocommerce' ),
'edit-account' => __( 'Account Details', 'woocommerce' ),
'special-page' => __( 'Special Page', 'woocommerce' ), // My custom tab here
'customer-logout' => __( 'Logout', 'woocommerce' ),
);
return $items;
}
It redirects to my-account/special-page .How do I create a custom link for the special page link ?它重定向到 my-account/special-page 。如何为特殊页面链接创建自定义链接?
Here your page slug name is required.此处需要您的页面 slug 名称。
your code你的代码
'special-page' =>
it's your page slug name For example like这是你的页面 slug 名称例如
'about-us' => __( 'My Page', 'woocommerce' ), // My custom tab here
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.