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
add_filter( 'user_meta_field_config', 'editOnlyBlank', 10, 2 ); | |
function editOnlyBlank( $field, $fieldID ) { | |
global $userMeta; | |
// Change Target_Field_ID | |
if ( $fieldID <> 'Target_Field_ID' ) return $field; | |
// Uncomments this line if an admin are allowed to edit value | |
// if ( $userMeta->isAdmin() ) return $field; | |
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
add_filter( 'user_meta_field_config', 'user_meta_field_config_function', 10, 3 ); | |
function user_meta_field_config_function( $field, $fieldID, $formName ){ | |
// (array) $field | |
// (int) $fieldID | |
// (string) $formName | |
return $field; | |
} |
NewerOlder