LLMS_Controller_Account::update()
Handle submission of user account edit form
Return Return
(void)
Source Source
File: includes/forms/controllers/class.llms.controller.account.php
public function update() { if ( ! llms_verify_nonce( '_llms_update_person_nonce', 'llms_update_person' ) ) { return; } do_action( 'llms_before_user_account_update_submit' ); // No user logged in, can't update! // This shouldn't happen but let's check anyway. if ( ! get_current_user_id() ) { return llms_add_notice( __( 'Please log in and try again.', 'lifterlms' ), 'error' ); } $person_id = llms_update_user( $_POST, 'account' ); // Validation or update issues. if ( is_wp_error( $person_id ) ) { foreach ( $person_id->get_error_messages() as $msg ) { llms_add_notice( $msg, 'error' ); } return; } elseif ( ! is_numeric( $person_id ) ) { return llms_add_notice( __( 'An unknown error occurred when attempting to create an account, please try again.', 'lifterlms' ), 'error' ); } else { llms_add_notice( __( 'Your account information has been saved.', 'lifterlms' ), 'success' ); // Handle redirect. llms_redirect_and_exit( apply_filters( 'lifterlms_update_account_redirect', llms_get_endpoint_url( 'edit-account', '', llms_get_page_url( 'myaccount' ) ) ) ); } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.7.0 | |
3.24.0 | Introduced. |