LLMS_Admin_Profile::save_user_meta_fields( int $user_id )
Maybe save user meta fields
Parameters Parameters
- $user_id
-
(int) (Required) WP_User ID for the user being updated.
Return Return
(void)
Source Source
File: includes/admin/class-llms-admin-profile.php
public function save_user_meta_fields( $user_id ) { if ( ! $this->current_user_can_edit_admin_custom_fields() ) { return; } $fields = $this->get_fields(); $posted_data = array(); foreach ( $this->fields as $field ) { //phpcs:disable WordPress.Security.NonceVerification.Missing -- nonce is verified prior to reaching this method. if ( isset( $_POST[ $field['name'] ] ) && isset( $field['data_store_key'] ) && $field['data_store'] && 'usermeta' === $field['data_store'] ) { //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- sanitization and unslashing happens in `LLMS_Form_Handler::instance()->submit_form_fields()` below. $posted_data[ $field['name'] ] = $_POST[ $field['name'] ]; } //phpcs:disable WordPress.Security.NonceVerification.Missing } if ( empty( $posted_data ) ) { return; } $posted_data['user_id'] = $user_id; $submit = LLMS_Form_Handler::instance()->submit_fields( $posted_data, 'admin-profile', $fields, 'update' ); if ( is_wp_error( $submit ) ) { $this->errors = $submit; } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |