LLMS_Form_Validator::sanitize_fields( array $posted_data, array[] $fields )
Sanitize all user-submitted data according to field settings
Parameters Parameters
- $posted_data
-
(array) (Required) User-submitted form data.
- $fields
-
(array[]) (Required) LifterLMS form fields settings.
Return Return
(array)
Source Source
File: includes/forms/class-llms-form-validator.php
public function sanitize_fields( $posted_data, $fields ) { foreach ( $fields as $field ) { if ( empty( $field['name'] ) || ! isset( $posted_data[ $field['name'] ] ) ) { continue; } $posted_data[ $field['name'] ] = $this->sanitize_field( $posted_data[ $field['name'] ], $field ); } return $posted_data; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |