Automator_Utilities::automator_sanitize( $data,  $type = 'text' )


Parameters Parameters

$data

(Required)

$type

(Optional)

Default value: 'text'


Top ↑

Return Return

(mixed|string)


Source Source

File: src/core/lib/utilities/class-automator-utilities.php

	public function automator_sanitize( $data, string $type = 'text' ) {
		switch ( $type ) {
			case 'mixed':
			case 'array':
				if ( is_array( $data ) ) {
					$this->automator_sanitize_array( $data );
				} else {
					$data = sanitize_text_field( $data );
				}
				break;
			default:
				$data = sanitize_text_field( $data );
				break;
		}

		return $data;
	}