Skip to content

Instantly share code, notes, and snippets.

@dustinleer
Created May 25, 2022 20:53
Show Gist options
  • Save dustinleer/3749729ea62dd283374bdc1ef8b7ce93 to your computer and use it in GitHub Desktop.
Save dustinleer/3749729ea62dd283374bdc1ef8b7ce93 to your computer and use it in GitHub Desktop.
Reorders WooCommerce menu links
<?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