Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save daddiofaddio/087e81526295b586d1c8de7da1dd9bf0 to your computer and use it in GitHub Desktop.
Save daddiofaddio/087e81526295b586d1c8de7da1dd9bf0 to your computer and use it in GitHub Desktop.
Woocommerce change text from "My Account" to "Login" when user logged out
/* WOOCOMMERCE CHANGE MYACCOUNT TO LOGIN */
add_filter('wp_nav_menu_items', 'dynamic_menu_item_label', 9999, 2);
function dynamic_menu_item_label($items, $args) {
if (!is_user_logged_in()) {
$items = str_replace("My Account", "Login", $items);
}
return $items;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment