Skip to content

Instantly share code, notes, and snippets.

@eri-trabiccolo
Created December 8, 2020 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eri-trabiccolo/9457bc0babccdba5a05b50c1d4809c0f to your computer and use it in GitHub Desktop.
Save eri-trabiccolo/9457bc0babccdba5a05b50c1d4809c0f to your computer and use it in GitHub Desktop.
llms - Disable names editing in account
<?php // <- do not copy this line
add_filter(
'lifterlms_get_person_fields',
function ( $fields, $screen ) {
if ( 'account' === $screen ) {
foreach ( $fields as &$field ) {
if ( in_array( $field['id'], array( 'first_name', 'last_name' ), true ) ) {
$field['disabled'] = true;
}
}
}
return $fields;
},
20,
2
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment