Support only during business hours : Monday to friday, from 8:30 am – 5:30 pm CEST

Due to the decrease in our staff due to vacations, our response time may be longer.

Be sure we're doing our best to manage your topic as soon as possible.

Change profile field name when viewing other member's profile

This topic is resolved
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • Malas Reda
    Participant
    • 13 Topics
    • 28 Posts
    @malasreda

    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,

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    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:

    Adding Custom PHP Without Changing Your Child Theme

    Regards,

    Malas Reda
    Participant
    • 13 Topics
    • 28 Posts
    @malasreda

    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 ?

    Malas Reda
    Participant
    • 13 Topics
    • 28 Posts
    @malasreda

    PS: The field will be created in another group field.

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    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,

    Malas Reda
    Participant
    • 13 Topics
    • 28 Posts
    @malasreda

    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 ?

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    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,

    Malas Reda
    Participant
    • 13 Topics
    • 28 Posts
    @malasreda

    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 ?

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    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,

    Malas Reda
    Participant
    • 13 Topics
    • 28 Posts
    @malasreda

    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

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    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,

Roboraptor 🦖
Themosaurus Topic Closer

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.

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Change profile field name when viewing other member's profile’ is closed to new replies.

Troubleshooting Demo Imports

You're trying to setup your theme but you're experiencing errors when importing the demo content? Or you've just followed the setup guide but your website doesn't look exactly like our demo? These are common issues for which you can find easy and quick fixes.

Happy With our Support So Far?

Feel free to review our theme on Themeforest! It helps us making our products more known to new potential customers, which allow us more time to improve the quality and develop new features. #SharingIsCaring ❤️

Discover MatchPress

Skip • Like • Super-Like

Add powerful matching features like Member likes, skips, super likes, conditional private messaging and much more.

Setup Your Cera or Gwangi powered Community Website and Turn it into an iOS and Android App

15% discount for Cera users

To unleash the full power of your Cera or Gwangi theme, we have partnered with the Zipline team. Your community website can now be fully setup and turned into your very own custom app for iOS and Android.

Whether you've newly acquired the theme or already got your site up and running, Zipline got you covered. And we got you an incredible discount.

Holiday, Weather & Festive effects
to pimp your WordPress Site