Created
December 8, 2020 11:05
-
-
Save eri-trabiccolo/9457bc0babccdba5a05b50c1d4809c0f to your computer and use it in GitHub Desktop.
llms - Disable names editing in account
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 // <- 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