This file contains hidden or 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 | |
| /** | |
| * Sync user_nicename with user_login so PMPro profile URLs | |
| * always reflect updated usernames. | |
| */ | |
| function pmpromd_sync_nicename_on_profile_update($user_id) { | |
| $user = get_userdata($user_id); | |
| if ($user) { | |
| $expected = sanitize_title($user->user_login); | |
| if ($user->user_nicename !== $expected) { |