2016-09-19 125 views
1

我能夠創建一個新的菜單項「專用頁面」使用此:WooCommerce自定義鏈接我的賬戶頁面自定義菜單項

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; 
} 

它重定向到我的賬戶/特殊頁。如何我是否爲特殊頁面鏈接創建自定義鏈接?

+0

看一看這個:https://github.com/woothemes/woocommerce/wiki/2.6-Tabbed - 我的帳戶頁 – LoicTheAztec

+0

您可以檢查它做到這一點:https://gist.github.com/duroe5698/e89aa6c18b3e02e7a050e36eeed02664 –

+0

這也是有用的:https://gist.github.com/claudiosanches/a79f4e3992ae96cb821d3b357834a005#file-定製我的賬戶端點的PHP –

回答

0

這裏您的頁面slu name名稱是必需的。

代碼

'special-page' => 

這是你的網頁塞名字例如像

'about-us' => __('My Page', 'woocommerce'), // My custom tab here