Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Popular Features › Member Profile › Change profile field name when viewing other member's profile
- This topic has 10 replies, 2 voices, and was last updated 6 years, 1 month ago by
Themosaurus.
-
AuthorPosts
-
Malas RedaParticipant@malasreda
- 13 Topics
- 28 Posts
Hello,
I have many fields on the register page. We can find those informations in the profile section for logged-in user also.
When the logged in user see other members profile, he can also see those information but i would like to change the name of the fields only for other members when logged in.
Exemple:
– On registration page : “what are you looking for ?”
– On Logged-in user profile page : “what are you looking for ?”
– When the logged-in user check other members profile : “Is looking for”Is it possible ?
Thank you,
January 30, 2019 at 11:54 #4924@themosaurus- 1 Topics
- 1675 Posts
Hi @malasreda,
Here is a code snippet that might help you:
add_filter( 'bp_get_the_profile_field_name', 'gwangi_change_profile_field_name' ); function gwangi_change_profile_field_name( $field_name ) { if ( bp_is_user_profile() && ! bp_is_my_profile() ) { switch ( $field_name ) { case 'What are you looking for': return 'Is looking for'; break; case 'Other field': return 'New name for other field'; break; } } return $field_name; }
Don’t forget to change the field names by your own. If you need to change more field names, you can also duplicate this part as many times as you need:
case 'Other field': return 'New name for other field'; break;
As a reminder, if you need to find out how to add a PHP code snippet to your site, we recommend that you visit this article of our documentation:
Regards,
January 30, 2019 at 12:02 #4927Malas RedaParticipant@malasreda- 13 Topics
- 28 Posts
Perfect it is working !
I need to put a new field wich is “Bio”. The user will fill text for his profile.
This field is only visible on the profile page and not on the registration page.
How can i do this ?
January 30, 2019 at 13:27 #4938Malas RedaParticipant@malasreda- 13 Topics
- 28 Posts
January 30, 2019 at 16:04 #4969@themosaurus- 1 Topics
- 1675 Posts
The registration form will only display fields that are in the “Base (Primary)” field group. That means if you create a new field group, all the field in that group will be displayed only in your profile.
To create new field groups, go to Users > Profile Fields then click “Add New Field Group” at the top of the screen. When your new field group has been created, you can create your “Bio” field in that new group.
Best regards,
January 30, 2019 at 16:50 #4971Malas RedaParticipant@malasreda- 13 Topics
- 28 Posts
This step is done.
Now i need to show this fiels on the profile page of each member under the profile section. And if i was the logged in user i should be able to modifie this field like the other registration field.
Is it possible ?
January 30, 2019 at 20:06 #4981@themosaurus- 1 Topics
- 1675 Posts
Hi @malasreda,
If you have correctly created your field group and your Bio field, it should already be displayed in member profiles. If it is not displayed, can you please try to edit the field and check the “Visibility” panel on the left to see if it is visible to members?
If it still doesn’t work, can you please create an account with administration access and share the credentials with us so that we can take a look directly on your website? Don’t forget to check the “Set as private reply” box in your next reply if you share credentials with us, so that only you and us can see your reply.
Best regards,
January 31, 2019 at 12:22 #4989Malas RedaParticipant@malasreda- 13 Topics
- 28 Posts
Oh thank you it works !
Under the “active il y a 3 min” we see the recent activity of every profile. I need to replace this by the bio field of every member! and if i am the user logged in and don’t have a bio yet,by default i want to show a link : “No bio yet, describe yourself here ” and on click they will land on the profile section to modify the bio field (the page in the screenshot).
Is this possible ?
January 31, 2019 at 12:38 #4993@themosaurus- 1 Topics
- 1675 Posts
Hi @malasreda,
You’re welcome, glad that we could help you 🙂
Unfortunately replacing latest activity with the bio is more complicated and we don’t have any snippet that we could share with you for that.
If you are familiar with modifying themes however, I can tell you that this is located in gwangi/buddypress/members/single/cover-image-header.php on line 131 in your Gwangi theme.
Please be aware that if you do modify Gwangi, your modifications will be lost if you update it later.
If you are not familiar with theme modifications, we recommend you to require the services from Envato Studio freelancers (https://studio.envato.com/explore/websites-programming). This web platform gives you access to developers who have already experience with theme customizations, and for very competitive prices.
Best regards,
January 31, 2019 at 15:07 #5007Malas RedaParticipant@malasreda- 13 Topics
- 28 Posts
Hello,
I used this snippet you gave me and it works perfectly,
add_filter( 'bp_get_the_profile_field_name', 'gwangi_change_profile_field_name' ); function gwangi_change_profile_field_name( $field_name ) { if ( bp_is_user_profile() && ! bp_is_my_profile() ) { switch ( $field_name ) { case 'What are you looking for': return 'Is looking for'; break; case 'Other field': return 'New name for other field'; break; } } return $field_name; }
If i want to change the fields name in the search profile directory filters which snippet should i use ?
Thank you
February 4, 2019 at 11:43 #5048@themosaurus- 1 Topics
- 1675 Posts
Hi @malasreda,
No need for another snippet to do that 🙂
From your admin dashboard, you just have to go to Users > Profile Search. Open the search form that is used in your member directory, and there you can change the “Label” and “Description” for any of your fields.
Best regards,
February 5, 2019 at 11:25 #5059 -
AuthorPosts
Hi there,
This topic has been inactive for a while now so we will be closing it to keep the forum tidy. Don't hesitate to create a new topic if you still need help and we'll be glad to help you!
Best regards,
The Themosaurus team.
The topic ‘Change profile field name when viewing other member's profile’ is closed to new replies.