Inventory_Presser_Plugin::sanitize_array( array $arr )

Sanitizes every member of an array at every level with sanitize_text_field()


Parameters Parameters

$arr

(array) (Required)


Top ↑

Return Return

(array)


Top ↑

Source Source

File: inventory-presser.php

		protected function sanitize_array( $arr ) {
			foreach ( $arr as $key => $value ) {
				if ( is_array( $value ) ) {
					$arr[ $key ] = $this->sanitize_array( $value );
				} else {
					$arr[ $key ] = sanitize_text_field( $value );
				}
			}
			return $arr;
		}