Sanitize textarea field in WordPress

/**
 * sanitize_textarea.
 */
function sanitize_textarea( $value ) {
	$value = explode( "\n", (string) $value );
	$value = array_map( 'sanitize_text_field', (array) $value );
	return implode( "\n", $value );
}

No comments yet.

Leave a Reply