Skip to:
Content
Pages
Categories
Search
Top
Bottom

Profile field visibiltiy


  • markyeoj
    Participant

    @markyeoj

    Hello,

    I’m working on the visibility of my profile fields but I am not sure how it really works so I have some questions.

    1. I want some profile fields to be visible to some specific user role. But allow the users of that role to set the visibility of the value of the field.

    For example, a long text field visible only for editors and admins. But allow them to set the value’s visibility if they want to share it to their friends or public or private. Is this possible?

    2. I have a profile field only visible for admin meaning only admin can see that profile field, but I want the value of that field visible to all. Is this possible?

    Thanks.

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

  • markyeoj
    Participant

    @markyeoj

    I forgot to mention that I am also using S2Member.


    danbp
    Participant

    @danbp

    Perhaps this can help you to go further.

    For point 2, maybe this snippet can do the job. Give it a try ! Add it to bp-custom.php

    function custom_display_xprofile_fields() {
    
    // single field item
    if ( $data = bp_get_profile_field_data( 'field=Industry' ) ) : // change field name to yours
    	echo '<div class="industry">'. xprofile_get_field_data( 'Industry', bp_displayed_user_id() ) .'</div>';
    endif;
    }
    add_action( 'bp_after_profile_loop_content' , 'custom_display_xprofile_fields' );
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar