Skip to:
Content
Pages
Categories
Search
Top
Bottom

Making Certain Xporfile fields ReadOnly or Locked

Viewing 1 replies (of 1 total)

  • danbp
    Participant

    @danbp

    Add this snippet to your child-theme functions.php or bp-custom.php

    function bpfr_hide_profile_edit( $retval ) {	
    	// remove field from edit tab
    	if(  bp_is_profile_edit() ) {		
    		$retval['exclude_fields'] = '2'; // field ID's separated by comma
    	}	
    	// allow field on register page
    	if ( bp_is_register_page() ) {
    		$retval['include_fields'] = '2'; // field ID's separated by comma
    		}		
    	
    	// hide the field on profile view tab
    	if ( $data = bp_get_profile_field_data( 'field=2' ) ) : 
    		$retval['exclude_fields'] = '2'; // field ID's separated by comma	
    	endif;	
    	
    	return $retval;	
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_edit' );
Viewing 1 replies (of 1 total)
  • The topic ‘Making Certain Xporfile fields ReadOnly or Locked’ is closed to new replies.
Skip to toolbar