Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Support: Creating & Extending

Existing and new plugins/components and themes.

Hide profile field (14 posts)

Started 1 year, 9 months ago by: Anton

  • Profile picture of Anton Anton said 1 year, 9 months ago:

    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.

  • Profile picture of nickmy nickmy said 1 year, 9 months ago:

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

  • Profile picture of r-a-y r-a-y said 1 year, 9 months ago:

    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.

  • Profile picture of nickmy nickmy said 1 year, 9 months ago:

    is not working @r-a-y

  • Profile picture of Paul Gibbs Paul Gibbs said 1 year, 9 months ago:

    You changed this bit?

    ‘ID # YOU WANT TO SKIP’

  • Profile picture of nickmy nickmy said 1 year, 9 months ago:

    yes I did

  • Profile picture of nickmy nickmy said 1 year, 9 months ago:

    @djpaul I also tried it with profile name

  • Profile picture of r-a-y r-a-y said 1 year, 9 months ago:

    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.

  • Profile picture of nickmy nickmy said 1 year, 9 months ago:

    THANKS :D

    it works

  • Profile picture of nickmy nickmy said 1 year, 9 months ago:

    @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

  • Profile picture of Roger Coathup Roger Coathup said 1 year, 9 months ago:

    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.

  • Profile picture of Anton Anton said 1 year, 9 months ago:

    thanks @r-a-y

  • Profile picture of Aliceembroid Aliceembroid said 1 year, 2 months ago:

    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.

  • Profile picture of Aliceembroid Aliceembroid said 1 year, 2 months ago:

    I have got this sorted out with buddypress profile privacy pluggin