WC_Product_CSV_Exporter::filter_description_field()protectedWC 3.5.4

Filter description field for export. Convert newlines to '\n'.

Method of the class: WC_Product_CSV_Exporter{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->filter_description_field( $description );
$description(string) (required)
Product description text to filter.

Changelog

Since 3.5.4 Introduced.

WC_Product_CSV_Exporter::filter_description_field() code WC 9.4.2

protected function filter_description_field( $description ) {
	$description = str_replace( '\n', "\\\\n", $description );
	$description = str_replace( "\n", '\n', $description );
	return $description;
}