1 回答

TA貢獻(xiàn)2036條經(jīng)驗(yàn) 獲得超8個(gè)贊
抱歉,我找到了解決方案。
以下代碼可以解決問題:
add_filter ( 'woocommerce_account_menu_items', 'misha_one_more_link' );
function misha_one_more_link( $menu_links ){
// we will hook "anyuniquetext123" later
$new = array( 'subscriptions' => __( 'Subscriptions', 'woocommerce' ), );
// or in case you need 2 links
// $new = array( 'link1' => 'Link 1', 'link2' => 'Link 2' );
// array_slice() is good when you want to add an element between the other ones
$menu_links = array_slice( $menu_links, 0, 1, true )
+ $new
+ array_slice( $menu_links, 1, NULL, true );
return $menu_links;
}
我只需要添加現(xiàn)有的端點(diǎn)。
- 1 回答
- 0 關(guān)注
- 101 瀏覽
添加回答
舉報(bào)