Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

  • Jason Lawton
    Participant

    @phoopee3

    If you look in the gist that I linked to, you’ll see that when the user updates their xprofile info, I update their nicename from their first and last name.


    Jason Lawton
    Participant

    @phoopee3

    I got it working, I was trying to use wp_get_current_user, which was using cached information, so I had to use get_userdata instead. Then I forcefully (search/replace) updated the url by replacing it in the $bp->displayed_user->domain.

    Full function available here: https://gist.github.com/phoopee3/69e991f08eb595efdaedb7a02bc0e8ef


    Jason Lawton
    Participant

    @phoopee3

    I’ve also tried wp_cache_delete( 'bp_user_username_' . $user_id, 'bp' ); which didn’t work either.

    I’ve also tried looking into changing it before it saves, via the xprofile_data_before_save hook, but not enough data gets passed to the function to update the nicename.


    Jason Lawton
    Participant

    @phoopee3

    I’m calling this via an add_action('xprofile_updated_profile', 'updateUserNicename', 1, 5); hook.

Viewing 4 replies - 1 through 4 (of 4 total)
Skip to toolbar