Skip to content

Instantly share code, notes, and snippets.

@actual-saurabh
Created November 1, 2018 17:25
Show Gist options
  • Select an option

  • Save actual-saurabh/f64a69e14d5a2148b734828ebd3dacc9 to your computer and use it in GitHub Desktop.

Select an option

Save actual-saurabh/f64a69e14d5a2148b734828ebd3dacc9 to your computer and use it in GitHub Desktop.
Remove field from registration and checkout screens
<?php // Do not copy this line.
// Copy from under this line and paste into your child theme's functions.php.
add_filter( 'lifterlms_get_person_fields', 'llms_remove_state_field', 10, 2);
function llms_remove_state_field( $fields , $screen ){
if( strcmp( $screen , 'checkout' ) == 0 ||
strcmp( $screen , 'registration' ) == 0) {
$fields = array_filter( $fields, 'llms_is_not_state_field' );
}
return $fields;
}
function llms_is_not_state_field( $field ){
if( 'llms_billing_state' === $field['id'] ){
return false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment