Created
November 1, 2018 17:25
-
-
Save actual-saurabh/f64a69e14d5a2148b734828ebd3dacc9 to your computer and use it in GitHub Desktop.
Remove field from registration and checkout screens
This file contains hidden or 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. | |
| // 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