add_filter( 'wp_nav_menu_items', 'snippetpress_change_my_account_label' ); function snippetpress_change_my_account_label( $labels ) { if ( ! is_user_logged_in() ) { $labels = str_replace( "My Account", "Log In", $labels ); } return $labels; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter