Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide Profile Field Group from Specific Member Type


  • ch1n3s3b0y
    Participant

    @ch1n3s3b0y

    Ok, so I am getting to grips with this 2.2 member types update.

    I’m trying to figure out how to hide specific profile field groups on the edit profile page. Some profile fields should only be visible to 1 group, not all.

    Does anyone have any idea of how to point me in the right direction?

    I know how to do this in terms of displaying profile fields, but not displaying them wthin ‘edit profile’.

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

  • modemlooper
    Moderator

    @modemlooper

    find the template file edit.php in members/single/profile
    locate
    if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) :
    change to
    if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() . bp_custom_filter_xprofile_fields() ) ) :

    then add your function for field IDs

    function bp_custom_filter_xprofile_fields() {
    
    	$member_type = bp_get_member_type( bp_displayed_user_id() );
    
    	if ( 'member_type_here' === $member_type  ) {
    		return '&exclude_fields=3,5,9' ) );
    	}
    }

    you will have to find the IDs of the profile fields


    ch1n3s3b0y
    Participant

    @ch1n3s3b0y

    Thanks ModemLooper. I’ll give this a shot tonight.


    thomasoriis
    Participant

    @thomasoriis

    @modemlooper – It could be nice if one could handle this from the xprofile fields in wp_admin as well – do you know how to do that ? I don’t think I have to request that feature I am sure it will come.

    Could be nice : )


    maelga
    Participant

    @maelga

    Do you guys have any snippet to display the xprofile fields ID in admin?
    The lesser I go to my db, the happier I am! 🙂


    johnywhy
    Participant

    @johnywhy

    the OP wants to hide a group, but i’m not seeing the groups at all. How to make them show?
    thx

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hide Profile Field Group from Specific Member Type’ is closed to new replies.
Skip to toolbar