Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide profile field

  • Avatar of Anton
    Anton
    Participant

    @antonrsa

    Is there a way to hide a certain profile field? I have a date of birth field that I use but I don’t want it to be visible to other members.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Avatar of nickmy
    nickmy
    Participant

    @nickmy

    I asked 1000 times how to hide special profile fields :P no answer @r-a-y @djpaul @hnla????

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    You have to ask 1000 and 1 times! ;)

    You have to modify the profile loop (/members/single/profile/profile-loop.php)

    Change this line:
    while ( bp_profile_fields() ) : bp_the_profile_field();

    to:
    while ( bp_profile_fields() ) : bp_the_profile_field(); if ( bp_get_the_profile_field_id() != 'ID # YOU WANT TO SKIP' ) :

    then change the corresponding endwhile; line to:
    endif; endwhile;

    That’s one way of doing it.

    Avatar of nickmy
    nickmy
    Participant

    @nickmy

    is not working @r-a-y

    You changed this bit?

    ‘ID # YOU WANT TO SKIP’

    Avatar of nickmy
    nickmy
    Participant

    @nickmy

    yes I did

    Avatar of nickmy
    nickmy
    Participant

    @nickmy

    @djpaul I also tried it with profile name

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Tested just now, works for me.
    You need to use the profile id #.

    Go to your profile field setup and check the ID by putting your mouse over the “Edit” field. The ID # is field_id.
    For example, “Name” is 1.

    Either that or go to your DB and manually look up the profile field id in the wp_bp_xprofile_fields table.

    You can also use any profile template tag and do your conditional.

    If you wanted to use the profile name, use bp_get_the_profile_field_name() instead.

    Avatar of nickmy
    nickmy
    Participant

    @nickmy

    THANKS :D

    it works

    Avatar of nickmy
    nickmy
    Participant

    @nickmy

    @r-a-y & @djpaul thank you very much I’ve got a last question what do I need to change if I want to hide more profile fields

    Avatar of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Get your list of ‘hidden’ field ids, add them to an array, and modify your if clause above to test whether the current id is in the array.

    This is one for you to look up in the PHP books.

    Avatar of Anton
    Anton
    Participant

    @antonrsa

    thanks @r-a-y

    Avatar of Aliceembroid
    Aliceembroid
    Participant

    @aliceembroid

    I found this thread and it looks like exactly what I need to stop users real names from displaying in there profile. the problem is I cannot find the file /members/single/profile/profile-loop.php
    can someone point me in the right direction. is it in buddypress pluggin or in wordpress main files?
    Alice.

    Avatar of Aliceembroid
    Aliceembroid
    Participant

    @aliceembroid

    I have got this sorted out with buddypress profile privacy pluggin

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

You must be logged in to reply to this topic.