Created
June 18, 2018 18:21
-
-
Save corypina/11e549693f0dfba9c0d827a33edc7bb7 to your computer and use it in GitHub Desktop.
Make a BuddyPress profile field un-editable. Requires the ID of the profile field(s)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function cp_makeProfileFieldUneditable( $retval ) { | |
if( is_user_logged_in() && bp_is_profile_edit() ) { | |
$retval['exclude_fields'] = '1'; // field id's | |
} | |
return $retval; | |
} | |
add_filter( 'bp_after_has_profile_parse_args', 'cp_makeProfileFieldUneditable' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment