13 seconds
By adding the code below to your theme’s functions.php
file (or in a custom plugin), you can add the Unclaimed Orders endpoint to the WooCommerce My Account page menu items.
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 | |
function acme_my_account_menu_items( $items ) { | |
// Get customer-logout menu item. | |
$logout = $items['customer-logout']; | |
// Remove the customer-logout menu item. | |
unset( $items['customer-logout'] ); | |
// Insert the unclaimed-orders endpoint. | |
$items['unclaimed-orders'] = __( 'Unclaimed Orders', 'acme' ); | |
// Insert back the customer-logout item. | |
$items['customer-logout'] = $logout; | |
return $items; | |
} | |
add_filter( 'woocommerce_account_menu_items', 'acme_my_account_menu_items' ); |
Was this article helpful?