wc_sanitize_textarea

Run wc_clean over posted textarea but maintain line breaks.

Description

(string) wc_sanitize_textarea( (string) $var ); 

Returns (string)

Parameters (1)

0. $var (string)
The var.

Usage

  1. if ( !function_exists( 'wc_sanitize_textarea' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-formatting-functions.php'; 
  3.  
  4. // The var. 
  5. $var = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_sanitize_textarea($var); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-formatting-functions.php  
  1. function wc_sanitize_textarea( $var ) { 
  2. return implode( "\n", array_map( 'wc_clean', explode( "\n", $var ) ) );