Reply To: Hide xProfile fields from EDIT
– Single profile page. From show tab and from EDIT tab (see snippet)
– From dashboard profile edit page: not possible – normally BP users shouldn’t have access to profile dashboard. They can manage their profile from front-end.
– From custom profile fields. (see snippet)
– From tabs every where. (see snippet)
Almost any described areas, as example
function bpfr_hide_profile_edit( $retval ) {
// remove field from edit tab
if( bp_is_profile_edit() ) {
$retval['exclude_fields'] = '54'; // ID's separated by comma
}
// allow field on register page
if ( bp_is_register_page() ) {
$retval['include_fields'] = '54'; // ID's separated by comma
}
// hide the field on profile view tab
if ( $data = bp_get_profile_field_data( 'field=54' ) ) :
$retval['exclude_fields'] = '54'; // ID's separated by comma
endif;
return $retval;
}
add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_edit' );