AnsPress_Validation::sanitize_tags( string $field )
Description #
Santitize tags field
Parameters #
- $fieldstring (Required)
Source #
File: includes/class/validation.php
private function sanitize_tags($field) { $this->fields[$field] = $this->fields[$field]; $tags = $this->fields[$field]; if ( ! is_array( $tags ) ) { $tags = explode( ',', $tags ); } $sanitized_tags = ''; if ( is_array( $tags ) ) { $count = count( $tags ); $i = 1; foreach ( $tags as $tag ) { $sanitized_tags .= sanitize_text_field( $tag ); if ( $count != $i ) { $sanitized_tags .= ','; } $i++; } } $this->fields[$field] = $sanitized_tags; }
Expand full source code Collapse full source code View on GitHub: includes/class/validation.php:249
Add your comment