Created
June 11, 2022 23:05
-
-
Save daddiofaddio/087e81526295b586d1c8de7da1dd9bf0 to your computer and use it in GitHub Desktop.
Woocommerce change text from "My Account" to "Login" when user logged out
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
/* 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