WC_Product_CSV_Exporter::filter_description_field()protectedWC 3.5.4

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

Метод класса: WC_Product_CSV_Exporter{}

Хуков нет.

Возвращает

Строку.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->filter_description_field( $description );
$description(строка) (обязательный)
Product description text to filter.

Список изменений

С версии 3.5.4 Введена.

Код WC_Product_CSV_Exporter::filter_description_field() WC 8.7.0

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