Member ID number in profile URL
- This topic has 3 replies, 2 voices, and was last updated 7 years ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Hello. I’m not precisely sure how member profile URL’s are generated. When I click on a user’s profile I get the URL https://commons.pratt.edu/members/xxxxxxx/profile/ where ‘xxxxxx’ is their internal school ID number. We’re not allowed to expose this number, even for internal audiences. Is there a way to mask or replace that ID? It’s not an internal wordpress User ID, but it seems to be pulling from our central LDAP database. Is there a way to replace or obscure that portion of the URL when viewing user profiles?
After digging around a bit, I realized that some users are identified by their username, while others are identified by their ID number. I’m not sure what’s causing the difference. It seems their user profiles have the same type of information. However, when I try to look at my user, for example, I can only access my profile using my ID number but not my username in the URL.
THIS WORKS- https://commons.pratt.edu/members/IDNUMBER/
THIS DOESN’T- https://commons.pratt.edu/members/USERNAME/
Any ideas on where I might look? Thank you.
In your LDAP setup, you probably synced the LDAP user ID to the user_login
and user_nicename
DB fields in the wp_users
table.
If you want BuddyPress to use something else for the profile URL, you can set the username in the user_nicename
DB field and BuddyPress will use that for the user profile URL.
Keep in mind that this might break whatever custom configurations you might have on your install.
If you’d rather not mess with altering the data in the user DB columns, you can also filter 'bp_core_get_user_domain'
and 'bp_core_set_uri_globals_member_slug'
.
View this ticket for more info:
https://buddypress.trac.wordpress.org/ticket/6694
Thank you, Ray. That was extremely helpful. I fixed it with a MySQL query.