{"_id":"56d88886b159f10b00304629","project":"549a321bf876ae0b00f33623","parentDoc":null,"category":{"_id":"56d88885b159f10b00304613","pages":["56d88886b159f10b0030461c","56d88886b159f10b0030461d","56d88886b159f10b0030461e","56d88886b159f10b0030461f","56d88886b159f10b00304620","56d88886b159f10b00304621","56d88886b159f10b00304622","56d88886b159f10b00304623","56d88886b159f10b00304624","56d88886b159f10b00304625","56d88886b159f10b00304626","56d88886b159f10b00304627","56d88886b159f10b00304628","56d88886b159f10b00304629","56d88886b159f10b0030462a","56d88886b159f10b0030462b","56d88886b159f10b0030462c","56d88886b159f10b0030462d","56d88886b159f10b0030462e","56d88886b159f10b0030462f","56d88886b159f10b00304630","56d88886b159f10b00304631"],"project":"549a321bf876ae0b00f33623","__v":1,"version":"56d88884b159f10b00304609","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-20T00:49:50.639Z","from_sync":false,"order":10,"slug":"developer-api","title":"Filters Reference"},"__v":0,"user":"549a320d5b50c21400fae689","version":{"_id":"56d88884b159f10b00304609","__v":3,"project":"549a321bf876ae0b00f33623","createdAt":"2016-03-03T18:55:00.567Z","releaseDate":"2016-03-03T18:55:00.567Z","categories":["56d88885b159f10b0030460a","56d88885b159f10b0030460b","56d88885b159f10b0030460c","56d88885b159f10b0030460d","56d88885b159f10b0030460e","56d88885b159f10b0030460f","56d88885b159f10b00304610","56d88885b159f10b00304611","56d88885b159f10b00304612","56d88885b159f10b00304613","56d88885b159f10b00304614","56d89250b159f10b003046d4","56da13977222d50b0070167c"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.2.1","version":"2.2.1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-20T04:12:19.382Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":13,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_new_person_address\"\n}\n[/block]\nFilter applied to array of address fields collected at registration before a new user is created. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apply_filters( 'lifterlms_new_person_address', array() );\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_login_errors\"\n}\n[/block]\nFilter applied when returning login errors.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apply_filters( 'lifterlms_login_errors', $validation_error, $_POST[ 'username' ], $_POST[ 'password' ] );\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_get_username_from_email\"\n}\n[/block]\nFilter applied when checking if emails can be used instead of usernames when logging in.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apply_filters( 'lifterlms_get_username_from_email', true )\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_login_credentials\"\n}\n[/block]\nFilter applied before checking user credentials at login.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apply_filters( 'lifterlms_login_credentials', $creds ), $secure_cookie );\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_user_registration_errors\"\n}\n[/block]\nFilter applied before returning registration errors\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apply_filters( 'lifterlms_user_registration_errors', $fields );\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_registration_redirect\"\n}\n[/block]\nFilter applied before returning the redirect uri after successful user registration.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apply_filters( 'lifterlms_registration_redirect', $redirect ) );\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"allow_password_reset\"\n}\n[/block]\nFilter applied before checking if user password reset is allowed.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apply_filters('allow_password_reset', true, $user_data->ID);\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_new_person_data\"\n}\n[/block]\nApplied before new user is created. Use to add custom registration fields to save method.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apply_filters( 'lifterlms_new_person_data', array() );\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"filters-registration","type":"basic","title":"Filters: Login & Registration"}

Filters: Login & Registration


[block:api-header] { "type": "basic", "title": "lifterlms_new_person_address" } [/block] Filter applied to array of address fields collected at registration before a new user is created. [block:code] { "codes": [ { "code": "apply_filters( 'lifterlms_new_person_address', array() );", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_login_errors" } [/block] Filter applied when returning login errors. [block:code] { "codes": [ { "code": "apply_filters( 'lifterlms_login_errors', $validation_error, $_POST[ 'username' ], $_POST[ 'password' ] );", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_get_username_from_email" } [/block] Filter applied when checking if emails can be used instead of usernames when logging in. [block:code] { "codes": [ { "code": "apply_filters( 'lifterlms_get_username_from_email', true )", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_login_credentials" } [/block] Filter applied before checking user credentials at login. [block:code] { "codes": [ { "code": "apply_filters( 'lifterlms_login_credentials', $creds ), $secure_cookie );", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_user_registration_errors" } [/block] Filter applied before returning registration errors [block:code] { "codes": [ { "code": "apply_filters( 'lifterlms_user_registration_errors', $fields );", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_registration_redirect" } [/block] Filter applied before returning the redirect uri after successful user registration. [block:code] { "codes": [ { "code": "apply_filters( 'lifterlms_registration_redirect', $redirect ) );", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "allow_password_reset" } [/block] Filter applied before checking if user password reset is allowed. [block:code] { "codes": [ { "code": "apply_filters('allow_password_reset', true, $user_data->ID);", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_new_person_data" } [/block] Applied before new user is created. Use to add custom registration fields to save method. [block:code] { "codes": [ { "code": "apply_filters( 'lifterlms_new_person_data', array() );", "language": "php" } ] } [/block]