aokpro
Forum Replies Created
-
Hi Thomas, thanks very much for your quick response. However, I didn’t find the lifterlms_get_person_fields.php. Could you pls kindly let me know modify which php file in the newest Version 3.21.1 and where do I paste all the following code;
/**
* Remove Country & State fields from LifterLMS Checkout and Registration
* @param array $fields array of existing field definitions
* @param string $screen id of the field set being rendered
* @return array
*/
function my_lifterlms_get_person_fields( $fields, $screen ) {// ensure we’re only modifying the checkout and registration fieldsets
if ( in_array( $screen, array( ‘checkout’, ‘registration’ ) ) ) {// want to remove more fields? get the field id by inspecting the “$fields” variable
// and then add that id to this array!
$remove = array( ‘last name’);// loop through all existing fields
foreach ( $fields as $i => $field ) {// ensure that the ID of the field is one we want to remove
if ( isset( $field[‘id’] ) && in_array( $field[‘id’], $remove ) ) {// remove it!
unset( $fields[ $i ] );}
}
}
return $fields;
}
add_filter( ‘lifterlms_get_person_fields’, ‘my_lifterlms_get_person_fields’, 10, 2 );Also you mentioned I can locate and label it, how do I relocate the fields and change label names in which php files?
Looking forward to hearing back from you soon.
Sincerely yours,
Aokpro