public function sanitizeInput(&$array) {
        foreach ($array as $key => &$value) {
            if(!is_array($value)) {
                if ($key == 'content') {
                    $value = sanitize_textarea_field($value);
                } else {
                    $value = sanitize_text_field($value);
                }
            } else {
                $this->sanitizeInput($value);
            }
        }

        return $array;
    }
public function sanitizeInput(&$array) {
        foreach ($array as $key => &$value) {
            if(!is_array($value)) {
                if ($key == 'content') {
                    $value = sanitize_textarea_field($value);
                } else {
                    $value = sanitize_text_field($value);
                }
            } else {
                $this->sanitizeInput($value);
            }
        }

        return $array;
    }
public function sanitizeInput ( & $ array ) { foreach ( $ array as $ key => & $ value ) { if ( ! is_array ( $ value ) ) { if ( $ key == 'content' ) { $ value = sanitize_textarea_field ( $ value ) ; } else { $ value = sanitize_text_field ( $ value ) ; } } else { $ this -> sanitizeInput ( $ value ) ; } } return $ array ; }
Sanitize array with input data
@param  array &$array Defualt array
@return array         Sanitized array
Sanitize array with input data