Clearing user nicename cache
I have a hook where when the user updates their first and last name, it updates their @ name as well. So if their name is ‘Jason Lawton’, their @ name is ‘@jason-lawton’. If they change their name to ‘Jay Lawton’ it will change their @ name to ‘@jay-lawton’.
The issue I’m running into is that when the user_nicename is updated, it doesn’t redirect to the proper url. It tries going to the url with the old username, like ‘/members/jason-lawton/’ instead of the updated ‘/members/jay-lawton’.
I’m trying to figure out what cache to invalidate, but I’ve tried stuff like
wp_cache_delete( 'bp_core_userdata_' . $user_id, 'bp' );but when the
bp_displayed_user_domain()is called it still gets the old incorrect value.
Any suggestions on how to clear out the user name? or a way to replace the value the
- You must be logged in to reply to this topic.