Created
May 25, 2022 20:53
-
-
Save dustinleer/3749729ea62dd283374bdc1ef8b7ce93 to your computer and use it in GitHub Desktop.
Reorders WooCommerce menu links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Reorder my-account menu | |
* | |
* @param array $menu_links Array containing menu items | |
* @return array Filtered links | |
*/ | |
function ip_reorder_my_account_menu( $menu_links ){ | |
$logout_link = $menu_links['customer-logout']; | |
unset( $menu_links['customer-logout'] ); | |
$menu_links['customer-logout'] = $logout_link; | |
return $menu_links; | |
} | |
add_filter ( 'woocommerce_account_menu_items', 'ip_reorder_my_account_menu', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment