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.


Top ↑

Return Return

(array)


Top ↑

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;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.